Search code examples
debuggingembeddedwatchdog

How to determine which task is dead?


I have an embedded system that has multiple (>20) tasks running at different priorities. I also have watchdog task that runs to check that all the other tasks are not stuck. My watchdog is working because every once in a blue moon, it will reboot the system because a task did not check in.

How do I determine which task died?

I can't just blame the oldest task to kick the watchdog because it might have been held off by a higher priority task that is not yielding.

Any suggestions?


Solution

  • A per-task watchdog requires that the higher priority tasks yield for an adequate time so that all may kick the watchdog. To determine which task is at fault, you'll have to find the one that's starving the others. You'll need to measure task execution times between watchdog checks to locate the actual culprit.