cancel
Showing results for 
Search instead for 
Did you mean: 

Number of Resets?

l90mehdi
Associate II
Posted on August 05, 2017 at 10:53

Hello every one 

I am working with STM32F405 series .

It is essential for me to know that How many times reset has been occurrence.

I have EEPROM  in my project board.so i can keep last status.

Which register should I monitor?

thank you . 

#reset
3 REPLIES 3
S.Ma
Principal
Posted on August 05, 2017 at 13:54

At the begining of main() read and increment a 32 bit eeprom quantity will do the job. Add an application way to clear the counter and make sure the value saturate. In stm32 there are registers in sys or rcc to know the reset causd, hot or cold reset, watchdog reset, etc... All reset will restart the code...

Posted on August 05, 2017 at 14:01

Hello!

At RCC_CSR iregister you  can use the PORRSTF  flag to see if you start after a POR reset or not.

you  can use the PINRSTF  to see if the reset is from RST pin

or you can use SFTRSTF to find if asoft reset has occured

Posted on August 05, 2017 at 14:16

RAM is not cleared across reset, but is invalidated via a power cycle. BKPRAM is also typically available

Add critical code into the Reset_Handler. The STM32 also have a reset reason register.

You could walk across a Flash page writing an erased word to mark a use cycle, using multiple pages you could record an extremely large use count.

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