20.2.4 System Reset Cause
In some applications there may be a need to execute a different program flow based on how the device was reset. For example, if the cause of reset was the Watchdog timer (WDT), this might indicate an error in the application, and a form of error handling or error logging might be needed.
For this reason, an API is provided to retrieve the cause of the last system reset, so that appropriate action can be taken.
Power supply reset: Resets caused by an electrical issue. It covers POR and BOD reset.
User reset: Resets caused by the application. It covers external reset, system reset, and watchdog reset.
Backup reset: Resets caused by a backup mode exit condition.