cancel
Showing results for 
Search instead for 
Did you mean: 

Generating Reset with software

handy
Associate
Posted on December 01, 2012 at 10:48

Is it possible to reset the STM32 with software, e.g. a command / register to reset STM32 ?

#reset-stm32
1 REPLY 1
Posted on December 01, 2012 at 13:24

Wouldn't NVIC_SystemReset()do the trick?

/** \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 */
}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..