This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC2640R2F: On-chip OAD - How to reset or restart an app from within the app?

Part Number: CC2640R2F

Tool/software: TI-RTOS

My application uses the CC2640R2 and is based on the on-chip OAD peripheral.

I'm using simplelink_cc2640r2_sdk_1_50_00_58 with CCS.

As part of the error handling functions, I want to "reset" the device if certain failures occur.

To do this, I installed my own exception handler, where I call "HCI_EXT_ResetSystemCmd(HCI_EXT_RESET_SYSTEM_HARD)".

(I used this technique on an earlier device with no problem, but it wasn't using OAD, and used an earlier version of TI-RTOS)


In testing, I can force an exception, and see the code stall at the first "while" (when it is uncommented).

When the first "while" is commented, I expect the system to "reset" (as if the app's main is called...) and the second "while" to never be reached.

However, if I force an exception with the first "while" commented out, the system doesn't reset and the system stalls at the second "while".

Is there a different method needed to "re-start" an app that uses OAD?

Thanks!

  • Attempting to embed the above code in the original post caused it to "hang" the posting. When the Post button was pressed, the rotating arrows just continued to rotate... I had to create a .JPG of the code and attach it to get it into the above reply!
  • Hello Ed,

    It sounds like the HCI reset is not functioning as expected. I am not sure why it should be any different for an OAD with Boot Image Manager. I have contacted the developer team for their comments. I will keep you posted.

    Regards,
    Prashanth
  • Hello Ed,

    You can call the driverLib SysCtrlSystemReset() API. The HCI command requires the kernel to be running , so if you are in a fault condition, calling the driverLib would be preferred.

    Best wishes
  • Hi JXS,

    Thanks for the suggestion.   I also saw a suggestion in another forum thread to use "HAL_SYSTEM_RESET()".

    Can you explain the differences between HAL_SYSTEM_RESET and SysCtrlSystemReset (or point to documentation where this might be explained)?

    I did find the DriverLib documentation, but when I tried to call "SysCtrlSystemReset()", it fails to link even though .../cc26x0r2/driverlib/bin/ccs/driverlib.lib is in the Linker File Search Path.

    Is there some other build time flag/option that should be set?

    Thanks!

    (I have to admit that I have a *very* difficult time finding information on specific calls/functions (and if used, what libraries to include in the build options for them to be found!) when trying to navigate through the online documentation...)

  • Hi Ed,

    Did you add:
    #include <driverlib/sys_ctrl.h>
    ?

    Both HAL_SYSTEM_RESET and HCI_EXT_ResetSystemCmd(HCI_EXT_RESET_SYSTEM_HARD) call SysCtrlSystemReset().

    The DriverLib Sys Ctrl APIs can be found here:
    software-dl.ti.com/.../group__system__control__group.html

    Best wishes
  • Thanks!

    I know it's probably assumed to be obvious, but I would suggest adding the "#include <driverlib/sys_ctrl.h> " (or appropriate include reference) to each of the API call sections. (Very much like Unix/Linux (section 3) man pages show the appropriate "includes" for each API)...

    Thanks again!