The watchdog in freeRTOS, it guarantees the device can restart if the system is crashed.
There may be some problems in freeRTOS with watchdog, no matter low or high the priority sets.
If I set the watchdog task the highest priority, when other tasks hang up, watchdog may work normally, and can’t reset the system;
If I set the watchdog task the lowest priority, when the feed dog timer expires, other higher priority task may be dispatched, and the watchdog reset the system.
So what should watchdog task priority be? And if any methods to solve the problem?
Generally, I find thet I want a watchdog task to be either the highest priority, to make sure that it runs, but then i checks on the status of the other critical tasks, it has the slight problem that if a non-critical lower priority task hangs and consumes all the time, that won’t be detected if it doesn’t interfere with a task that I declared critical (so perhaps less of a problem).
The other option, which is only sometimes usable is to make it very low priority, but then it imposes a real time requirement on all the tasks in the system.
Which of these works best, is dependent on your requirements, but most often I use the high priority option and make certain that a very low priority task is running often enough to catch other tasks locking up the less critical tasks.