How to detect STM32F417 MCU reset source
I try implement a function to detect how the MCU start from, reset from watchdog or hardfault or recycle power.
Watchdog reset, if the code goes to dead loop, it will trigger WD, but I have no good idea how to capture it.
Recycle power, I can use PVD_IRQHandler() interrupt, but I can't find how to configure the PWR_PVD parameter from STMCube .
Hardfault, I can use the HardFault_Hander() interrupt routine, it works for me.