Embedded

Watchdog Timer in Embedded Systems: Progress Checks and Recovery

By CourseTron Team ·  5 min read 💬 𝕏 in f

A watchdog detects missing or mistimed service activity and can trigger a configured recovery action, often a reset. It is useful only if servicing reflects meaningful system progress. A timer interrupt that blindly refreshes the watchdog can keep a stalled application alive indefinitely.

Reviewed 12 November 2026 · Worked examples with stated assumptions

On this page

What failure is the watchdog meant to detect?

Start with a fault model: a stalled main loop, deadlocked task, missed acquisition or lost clock. Different watchdog implementations cover different failures. Check whether the watchdog clock and reset path remain active in the relevant power and fault conditions.

A watchdog does not prove that computed results are correct. A program can make regular progress while producing invalid output.

Use progress from the required activities

In a teaching system, acquisition and processing each advance a progress counter after completing a meaningful operation. A supervisor services the watchdog only when both have advanced within the allowed interval and no blocking fault is active.

Read counters consistently, handle wrap, and design for tasks with different rates. “The task was scheduled” is weaker evidence than “the required work completed.”

What does a windowed watchdog add?

A windowed watchdog restricts service to an allowed time interval. Servicing too early can be treated as a fault as well as servicing too late. The exact window boundaries and tolerance are device-specific.

For a purely illustrative open interval from 20 to 80 ms, choose a nominal service point with margin from both edges. An arithmetic boundary test is useful, but actual clock tolerance, jitter and software latency must be included before setting a real device.

Plan what happens after reset

Capture reset cause if the hardware supports it, initialize outputs to defined values, and avoid repeatedly resuming the same corrupt operation. Consider persistent data integrity and interrupted writes. Repeated resets may need a diagnosed fallback state rather than an endless restart loop.

A safe state is application-specific. This guide does not define a safety policy for medical, automotive or other critical equipment.

How should a watchdog test be performed?

  • Test a stalled producer and a stalled consumer separately.
  • Verify that an unrelated heartbeat cannot conceal either stall.
  • Check early and late service for a windowed design.
  • Verify reset-cause reporting and startup recovery.
  • Repeat under relevant clock and power configurations.

The supplied software checks cover the illustrative progress policy. They do not reset any live system or validate a hardware watchdog.

Common questions

Is refreshing from a periodic ISR always safe?

No. The ISR can continue while essential foreground work is stuck. Tie service to the required progress policy.

Does an independent watchdog cover every clock failure?

No. Review the exact clock, power and reset architecture and the failure modes it can observe.

References and practice checks

The practice package includes original arithmetic models, a small RTL simulation and a host C exercise. Each states its test boundary; none is a silicon or board validation claim.