Skip to content
RED SAGSkills
mediumEmbedded Systems Engineer interview question

How would you design a watchdog strategy for firmware running several RTOS tasks?

What the interviewer wants to hear

  • Hardware independent watchdog with its own clock
  • Monitor task collects check-ins from each critical task
  • Refresh only when all tasks are healthy
  • Never kick from a timer ISR
  • Record reset cause and context to diagnose watchdog resets

Model answer

I use the independent hardware watchdog, which runs from its own clock so it still works if the main clock fails, and I enable it early in boot. Each critical task sets a check-in bit or increments a counter every time it completes its loop. A monitor task, or a low-priority supervisor, checks that every task has checked in within its expected period, and only then refreshes the watchdog. If one task hangs or deadlocks, the refresh stops and the device resets. I never kick from a timer ISR, because interrupts often keep running when tasks are stuck. A window watchdog can also catch code that runs too fast or loops wrongly. After reset I read the reset cause register and save information such as which task missed its check-in to a no-init RAM area, so field watchdog resets can be diagnosed.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Embedded Systems Engineer questions