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.