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.

CC2640 system reset

Other Parts Discussed in Thread: CC2640

Hello, experts

I am currently working on a product based on CC2640. I have a little question about system reset.
In the last step of OAD for external flash procedure, it restarts system by enabling "Warm Reset Converted to System Reset" and
watchdog function. Process would enter a infinite "for loop" until timeout of watchdog takes place.

/* Trigger reset */
HWREG(PRCM_BASE + PRCM_O_WARMRESET) = 4;
WatchdogResetEnable();
WatchdogEnable();
WatchdogReloadSet(0);

/* Enable reset interrupt */
CPUcpsie();

/* Stay here till reset.
* Note that if exception other than reset occurs, the device shall be lost. */
for (;;);

I wonder about that

1. What is the difference between previous code snippet and

HWREG(AON_SYSCTL_BASE + AON_SYSCTL_O_RESETCTL) = AON_SYSCTL_RESETCTL_SYSRESET;

2. Are these two methods both MCU's internal operations ?

Do they depend on any external hardware or operation ?
Is there any reason or possibility to prevent system from reset after we invocate the previous two methods ?

Sometimes, OAD procedure cannot finish because it gets stuck in the "for loop".
However, I think the main OAD procedure was done successfully because the internal flash would contain new image we just updated and
device would work correctly if we power off and on it again.

Any suggestion will be appreciated.

  • Hello,

    It is advised to use the latter reset option as this will perform a system reset, similar to a pin reset. I'll check to see why the other method is used for OAD.

    Best wishes
  • Hi, JXS

    Thank you for your reply !
    However, except for difference between these two methods, would you please tell me if
    layout of hardware, like hardware reset pin, would interfere with these operations or not ?

    Besides, if I think system gets stuck in this procedure, is there any method to verify this and
    any clue to find out the root cause ?

    Thank you.
  • Hi, i'm facing the exact same problem. The first time i try to use OAD, the BIM does not reset. I have to power off and on the board to make it work again. I know the OAD process succeeded because the firmware version has changed.

    Can you provide more information about how you made it work? 

    Thank you.

    Best regards

    Etienne GARIN

  • Hi, Etienne

    Sorry for late reply. My issue results from the incorrect procedure of generating OAD image. I am not sure but I think the interrupt vector is corrupt.

    Besides, the OAD procedure I followed is for full image off-chip updating. You could refer to this 

  • Hi Bohan, 

    thank you for your reply. I noticed by digging a bit more into the issue that my problem is not actually the same. I decided to switch on LEDs when entering the BIM. I did the same on the application side during OAD. What i noticed is that the application completes OAD, HAL_SYSTEM_RESET() is called and then the LEDs on the BIM side are not switched on. I guess i do not even enter the BIM. 

    The question now is: why is the BIM not called at reset? Or is the CC2640 held in a blocked state while resetting? 

    I also noticed that it fails every time after using JTAG (programming with CCS, reading flash with Flash Programmer 2, and so on...). However, its seems to work fine when i power off and on the board after JTAG programming. Can't confirm it works 100% though.

    Are you aware of any issue due to JTAG when rebooting the board? I am not using SensorTag hardware so the SPI and the JTAG are not multiplexed. I am also using the SBP BIM so my application starts at the address 0x1000.  

     Thank you for your help anyway.

    Best Regards,

    Etienne GARIN

    PS: just reminded that sometimes, even the Flash Programmer 2 software fails to reboot the MCU after an operation. This is rarely happening but it happened several times.