Dear all,
In my code, I would like to make a hot start function code so i can recall this function in anytime to implement the processor hot restart from start address 0x00000000, just like the watch dog function.
In the hot start function, I would like to use assembly code to jump address 0x00000000. But i am not sure it is the good way for this hot restart function. Would you have any better way to implement this hot restart function? Please let me know. I will appreciate for your any comments or feedback.
Thanks in advance!
Jerry
Hi,
If you are using CMSIS and it is just a software reset you want then NVIC_SystemReset(); will achieve this for you.
/** \brief System Reset
The function initiates a system reset request to reset the MCU.
*/
__STATIC_INLINE void NVIC_SystemReset(void)
{
__DSB(); /* Ensure all outstanding memory accesses included
buffered write are completed before reset */
SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
(SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
SCB_AIRCR_SYSRESETREQ_Msk); /* Keep priority group unchanged */
__DSB(); /* Ensure completion of memory access */
while(1); /* wait until reset */
}
Gabriel
Hi Jerry,
are you asking how to do a software restart/reset? See How to Reset an ARM Cortex-M with Software | MCU on Eclipse .
I hope this helps,
Erich
Hi Jerry,
It has the hyperlink in it, here again:
http://mcuoneclipse.com/2015/07/01/how-to-reset-an-arm-cortex-m-with-software/
Erich