The S32 SDK provides Peripheral Driver for the Watchdog timer (WDOG) module of S32 SDK devices.
.
Hardware background
The Watchdog Timer (WDOG) module is an independent timer that is available for system use. It provides a safety feature to ensure that software is executing as planned and that the CPU is not stuck in an infinite loop or executing unintended code. If the WDOG module is not serviced (refreshed) within a certain period, it resets the MCU.
Features of the WDOG module include:
- Configurable clock source inputs independent from the bus clock
- Programmable timeout period
- Programmable 16-bit timeout value
- Optional fixed 256 clock prescaler when longer timeout periods are needed
- Window mode option for the refresh mechanism
- Programmable 16-bit window value
- Provides robust check that program flow is faster than expected
- Early refresh attempts trigger a reset
- Optional timeout interrupt to allow post-processing diagnostics
- Interrupt request to CPU with interrupt vector for an interrupt service routine (ISR)
- Forced reset occurs 128 bus clocks after the interrupt vector fetch
- Configuration bits are write-once-after-reset to ensure watchdog configuration cannot be mistakenly altered
- Robust write sequence for unlocking write-once configuration bits