what is the difference between hardware watchdog and software watchdog?

M Sharath Hegde picture M Sharath Hegde · Sep 17, 2013 · Viewed 23.1k times · Source

what is the difference between hardware watchdog and software watchdog ?

Answer

old_timer picture old_timer · Sep 17, 2013

A hardware watchdog is hardware. Software watchdog is software. For a hardware watchdog, there is hardware that if it is not kicked often enough will assume the software has hung and will reset the system usually or whatever the design dictates. The hardware is assumed to be more reliable than the software. For a software watchdog, one software task/thread/whatever is assumed to be more reliable than another, if the questionable code fails to kick the reliable code then the reliable code kills the questionable code (or whatever the design dictates). There is a problem if the questionable code fails due to hardware which could take down all of the code including the software watchdog. So a software watchdog is only useful if you have the watchdog running in such a way that it is more reliable than the task in question, for example it may be there to prevent a task from wandering out of its memory space and getting a protection fault (which you could have just watched for in a fault handler rather than setup a watchdog, but anyway)...