cancel
Showing results for 
Search instead for 
Did you mean: 

how to find the reset reason in STM32H743 device

Anand Ram
Associate III

i would like know the cause of reset during the power on stage for may application.

i would like to differentiate if its power on reset/NVIC reset/WDG reset or any other cause?

2 REPLIES 2
Danish1
Lead II

The reference manual describes the RCC Reset Status Register RCC->RSR.

The bits in there are cumulative. Once you have read and handled a particular cause of reset, you need to set RMVF to clear them ready to record the next reset by doing RCC->CSR = RCC_CSR_RMVF;

Hope this helps,

Danish

Anand Ram
Associate III

hi @Danish​ ,

Thanks for your response.

Please find the example

uint32 reset_status = 0;

 reset_status = READ_BIT(RCC->RSR, RCC_RSR_PORRSTF);

  if(reset_status==0x00800000) // POWER on reset

{

}

Please not its important to deinit and clear all the flags before the reset to get the actual reset value from RCC_RSR register.

Also, while testing please avoid the debug mode.