Configuration of the WWDG to periodically update the counter and generate an MCU WWDG reset when a user button is pressed. The peripheral initialization uses the LL unitary service functions for optimization purposes (performance and size).
Example Configuration:
Configure the WWDG (Window, Prescaler & Counter) and enable it. Refresh the WWDG downcounter in the main loop - LED4 is blinking fastly & continuously
Example Execution:
When User push-button is pressed, the Downcounter automatic refresh mechanism is disable and thus, reset will occur. After a reset when re-entering in the main, RCC WWDG Reset Flag will be checked and if we are back from a WWDG reset the LED4 will be switch ON.
Waiting a new User push-button pressed to re-activate the WWDG
System, WWDG, Timeout, Refresh, Counter update, MCU Reset, Downcounter, Event, Window
This example runs on STM32C031C6Tx devices.
This example has been tested with NUCLEO-C031C6 board and can be easily tailored to any other supported device and development board.
In order to make the program work, you must do the following :