embedded
runtime_error
ai_generated
true
IWDG reset detected: system restarted by independent watchdog timeout
ID: embedded/watchdog-timeout-reset
80%Fix Rate
85%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 32 | active | — | — | — |
Root Cause
Watchdog timer reset the MCU because firmware did not refresh it in time. Infinite loop, deadlock, or blocking delay.
genericWorkarounds
-
88% success Check reset source register to confirm watchdog reset
if (RCC->CSR & RCC_CSR_IWDGRSTF) { /* IWDG caused reset */ } RCC->CSR |= RCC_CSR_RMVF;Sources: https://openocd.org/doc/html/
-
90% success Add watchdog refresh in all long-running loops and blocking waits
while (wait_for_sensor()) { HAL_IWDG_Refresh(&hiwdg); } // prevent timeout during legitimate waits -
82% success Use a dedicated low-priority RTOS task to feed the watchdog
If lowest-priority task runs, all higher-priority tasks are not starving the system.
Dead Ends
Common approaches that don't work:
-
Disable the watchdog entirely
88% fail
Watchdog exists for safety/reliability. Disabling it hides the root cause; system hangs without recovery.
-
Increase watchdog timeout to maximum value
70% fail
Masks the problem temporarily. If code hangs for even longer, the crash returns.