-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write program for Sensor Controller (CC26xx) #2019
Comments
Yes that is correct. I would suggest to use SCS since it is much easier to use, but it is possible to write programs for the sensor controller without using SCS. The main CPU will need to load the program into the sensor controller RAM. Suggest to look the sensor controller trainings here: ti.com/simplelinkacademy |
Thank you @jonnteolsson. I've managed to write a program in SCS. ADC and event code work well in Task Testing of SCS. Now I need to include this program into Contiki. TI's Simplelink Academy described this process for TI-RTOS, but not for Contiki. What do I need to import these files into Contiki and compile it? As far as I look through Contiki port of CC26xx, there is mechanism to interact with AUX, but I cannot find any info about including AUX application code to Contiki. |
You can use SCS to generate a bare-metal code using CCS.
The integration with contiki is very straightforward.
You will see that it will generate an init code (that you can run onde
anywhere on contiki) and some interrupts (that can ideally fire events in
contiki to signal your application).
We have been using this for a while without any problems with contiki and
with other RTOSes.
Marco Casaroli
…On Wed, Dec 28, 2016 at 10:43 AM, Semyon Tarakanov ***@***.*** > wrote:
Thank you @jonnteolsson <https://github.com/jonnteolsson>. I've managed
to write a program in SCS. ADC and event code work well in Task Testing of
SCS. Now I need to include this program into Contiki. TI's Simplelink
Academy described this process for TI-RTOS, but not for Contiki. What do I
need to import these files into Contiki and compile it?
As far as I look through Contiki port of CC26xx, there is mechanism to
interact with AUX, but I cannot find any info about including AUX
application code to Contiki.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2019 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADszaHFjy9moPwSfd4zUiZOkQhfYw29lks5rMlljgaJpZM4LVLeg>
.
|
In addition to copying the code to sensor controller RAM and starting the controller, I would suspect you also need code so the main MCU can handle events from the controller. I would also think you'd have to manipulate clocks within AUX so the controller can keep running while the rest of the chip is powered down. Marco, did you have to do any of that clock and power manipulation? |
Hello George.
In my experience, the code generated already does the lpm and clocks
initialization
I need to check if there was anything we needed to change in contiki lpm
code but I think we didn't.
I do not have a computer available right now for me to check. I will post
some instructions on how to do it in january.
BR
…On Wed, 28 Dec 2016 at 11:25 George Oikonomou ***@***.***> wrote:
In addition to copying the code to sensor controller RAM and starting the
controller, I would suspect you also need code so the main MCU can handle
events from the controller. I would also think you'd have to manipulate
clocks within AUX so the controller can keep running while the rest of the
chip is powered down.
Marco, did you have to do any of that clock and power manipulation?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2019 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADszaEI9Bcop7xjSvKmKZEYgQWan2tLnks5rMmNBgaJpZM4LVLeg>
.
|
I "sort of" integrated the SC with Contiki, but I'm experiencing some issues. /---------------------------------------------------------------------------/ PROCESS_BEGIN(); ti_lib_sys_ctrl_power_everything(); // Stop SC. // Run all clocks at full speed for now. // Enable events (half full RX FIFO or 10 bit period timeout scifUartTxPutChars("Hello how's everything? This is a long string\r\n",47); |
OK, the code I posted before does indeed work like a charm for UART emulation in Contiki via the Sensor Controller. |
OK. It is not so easy to do this thing. Here is my two little step. First I write the simplest program for Sensor Controller in SCS and use only Execution Code with one line of code:
I include them to the build by adding
Then For my second step I tried to iterate over the Execution Code with schedule. To iterate over Execution Code you need to add
Contiki project code:
This code should check button state every 1 second and light the led. But it fails. Actually, if you hit the button while powering the board, SC will see that and will light the LED. It tells that one iteration of Execution code was done. Then something happened - the code failed or schedule failed. So I am stuck here. Has anybody succeeded with this? |
hi @tarakanov, I am stuck at the same position in your previous post. I wanted to check if you had made any progress with this? |
I manage to run SC image periodically. Recall, to run Execution code you need to add
But it is conflicted with the AON RTC interrupt handler in
I change combine event to this, and soc_rtc_isr will not handle events from ch2: @g-oikonomou please advise here. If Contiki uses only ch0 and ch1 for timers, maybe it is good to remove all uses of ch2 from soc-rtc.c? |
I manage to make an alert to Contiki via events. To alert the main core you need add fwGenAlertInterrupt(); in the Execution Task. When you initialize SC in the Contiki, you need to register callback function for this alert:
Callback function will allocate event to the process (
Then you can identify this event by its name:
|
That expression must be done only once, in the initiation code. It assigns a unique number that represents those Sensor Controller events. |
Hmm ... |
I am not so sure about that, |
OK. I looked at the code again. Now, I think that you're right. |
Thanks for your instructions @tarakanov Very Helpful! It seems like you have discovered an incompatibility of contiki with CC1350 AUX. Another way of fixing the problem is by NOT disabling RTC_CH2 if(ti_lib_aon_rtc_event_get(AON_RTC_CH2)) { I dug a bit deeper and found that aux_ctrl_register_consumer() triggers AONWUC_AUX_WAKEUP, which causes soc_rtc.c to disable AON_RTC_CH2. My question here is that why does contiki (soc-rtc.c) disable AON_RTC_CH2. What it is doing is killing any interrupts from the AUX, immediately after waking it up. Which leads me to the question - Is it safe to disable AON_RTC_CH2. Does any other code in the contiki environment use it? |
cc2538: fix format specifiers
Hi!
I would like to write sensor handling program for Sensor Controller (AUX) of CC2650. As far as I understand, I need to use Sensor Controller Studio (SCS) to do this. Then I need to write Contiki app for main CPU. And this two programs can interact via semaphores and AUX RAM.
The text was updated successfully, but these errors were encountered: