[En-Nut-Discussion] Watchdog issues

Ralph Mason ralph.mason at telogis.com
Thu Sep 15 11:33:59 CEST 2005


Call me a joy killer, but having an interrupts issue a wdr is about the 
worst idea you could ever ever ever ever ever ever ever ever have! You 
software can crash and you will still get  interrupts.

Here suggestion with watchdogs under nut os. Only the idle thread should 
ever tickle the watch dog, your other threads can signal that with a 
yield - so in effect yield becomes a wdr.  secondly your idle thread 
should track watchdogs from all the other systems in your application, 
those systems (threads) should reset a counter that that watchdog looks 
at.  The idle thread should count down these timers and if they reach 0 
then stop issuing wrd's.  This means that all your threas must issue 
yields every 1 second or so and every so many seconds (what ever your 
set the counter to) make a call to reset the countdown (don't do both in 
a loop).  Finally create a top priority thread (0) that only has a task 
of reseting it's counter and then sleeping, this will check that no 
other threads are being starved.  This is about the only way I think you 
can actually check the health of a nut app using the watchdog timer.

Now if ionly we could solve the problem of bad code jumping into the 
bootloader randomly write a page of memory, there by renendering your 
whole device useless.

Cheers
Ralph

> Ulrich
>
> Just under 2 seconds is about right. 
> I suggest you set up your own timer, eg. timer1 and have it trigger 
> every 0.5 seconds or so.  In the interupt routine, you should check 
> the health of your system and issue "wdr" if appropriate.
>
> I use 0.5 seconds rather than longer because the Ethernet low level 
> code  goes off sometimes for a bit of a holiday and sometimes 1 second 
> is too slow.
>
> Cheers
> Brett
> -----------------------------------------------------------------
> Brett Abbott, Managing Director, Digital Telemetry Limited
> Email: Brett.Abbott at digital-telemetry.com
> PO Box 24 036 Manners Street, Wellington, New Zealand
> Phone +64 (4) 5666-860  Mobile +64 (21) 656-144
> ------------------- Commercial in confidence --------------------
>
>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>




More information about the En-Nut-Discussion mailing list