Tech Support > Computer Hardware > Microprocessors > Re: Watchdog timers & Cooperative OS'es
Re: Watchdog timers & Cooperative OS'es
Posted by Dingo on August 7th, 2003


"Ralph Mason" <masonralph_at_yahoo_dot_com@thisisnotarealaddress .com> wrote in message news:<5IdYa.107795$JA5.2391890@news.xtra.co.nz>...
I've seen the high priority vs. low priority choice develop into a holy war.
The high-priority option will cause the WDT to trigger reset when the system
goes to pot, or the scheduler stops working properly. But it won't detect
an instance where one of the threads locks up. The low priority option will
trigger the reset in the same instances as the high priority type will, as
well as when a thread above idle blocks processing on lower priority threads.

Both options are appealing, but often a combination of the two is the best.
Set up a flag that the idle thread can use to indicate that it has executed.
Have the high priority thread check for this flag and reset it. If the
flag hasn't been set, the thread can access state information so you can
determine why the idle thread didn't execute. Then, depending on your
desired system behavior, you can toggle the watchdog or not.

This idea can be extended so that each of the threads has a bit that must
be set so the watchdog thread can verify that they've executed. By using
both a low and high priority thread for WDT handling, you gain a lot of
flexibility in the way error situations are handled.

Posted by Ralph Mason on August 7th, 2003


"Dingo" <dingoatemydonut@aol.com> wrote in message
news:1303dc66.0308070835.4489234f@posting.google.c om...

Thanks Dingo,

This is a very good idea, I can have my idle thread set a global to some
count, and the high priority watchdog thread count that down, if it ever
reaches 0 then it stops kicking the watch dog.

Seems that this really is the best of both worlds. Easy for tasks to use.

I am also going to check for free ram in the watchdog, the system runs with
a nice buffer of free ram, if it drops too low it can reset (which it should
never do), meaning all my tasks don't need to bother checking for low ram
situations that shouldn't happen anyway.

Ralph




Similar Posts