On 2021-03-14 19:27, Gregory Nutt wrote:
Of course. But it will not be easy to do if you want to watch multiple
threads. Because the hardware watchdog is very binary. If any thread
were to kick the watchdog, it will not do a reset. So if one thread is
hung, but others still run, your hardware watchdog will not do what
you want, possibly.
I have using an approach in the past where each thread indicates that it
wants to reset the watchdog (by, say, setting a bit in a global bitset
or sending a messages to a "master" thread). The hardware is not
actually reset until all participating threads have requested the
reset. If one thread hangs, there is no reset and the watchdog will
expire. You an also see which thread was the culprit.
Yeah. I've been doing something like that as well.
Seems like a reasonable solution, which gives all the functions I like,
while still possible to keep very simple.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol