2021-12-29 08:32 AM
I need issue software reset after 1s when power up stm32f0xx, like press hardware reset button but i need in software. plz help me implement only one time after amount 1 second when power up stm32.
Solved! Go to Solution.
2021-12-29 09:02 AM
You can check if the last reset was a software reset by reading RCC_CSR flags.
You can check the approximate time from reset by looking at HAL_GetTick() >= 1000.
You can perform a software reset by calling HAL_NVIC_SystemReset.
Put those three together.
2021-12-29 08:42 AM
In reset flag you can check power on reset and do for example iwdg
2021-12-29 09:02 AM
You can check if the last reset was a software reset by reading RCC_CSR flags.
You can check the approximate time from reset by looking at HAL_GetTick() >= 1000.
You can perform a software reset by calling HAL_NVIC_SystemReset.
Put those three together.
2021-12-29 05:01 PM
Thanks for answer!
it not what i want. i can use iwdg or NVIC_SystemReset in normal mode, but not in this situation.
after power up MCU, if i put NVIC_SystemReset in code or timer, next time it will reset, but i only want it reset one time. And, after reset it will working normal and do not executed reset command any more. (only executed soft reset one time when power up)
2021-12-29 06:42 PM
2021-12-29 11:35 PM
@TDK
Thanks so much, i dont know stm32 have some reset flag to monitor reset status of MCU. This is exactly what i need, just monitor SFTRSTF bit in RCC_CSR will know hardware or software reset
2021-12-30 11:55 AM
Taka a note that the software reset bit (SFTRSTF) will be set also on NRST pin reset and therefore on POR/BOR resets also. Most likely you have to check POR/BOR or NRST reset flags for your goal.
2021-12-30 08:20 PM
Thanks for your suggestion Piranha.