Saturday, November 28, 2009

Should we enable or disable watch dog during the startup/boot code executes??

Can Anyone tell me whether we should enable or disable watch dog during the startup/boot code executes?My friend told me that we usually disable watch dog in the boot code. Can anyone one tell me what is the advantage or disadvantage of doing so??


Answers:

1.Usually the WD (watchdog) is enabled after the boot-up procedure, because this is when the program enters its "loop" and periodically kicks the WD. During boot-up, by which I suppose you mean linear initialization of hardware and peripherals, there's much less periodicity in your code and hard to insert a WD kicking cycle.

2.If you're debugging, you want it off or the device will reboot on your when you try to step through code. Otherwise it's up to you. I've seen watchdogs save projects' butts and I've seen watchdogs lead to inadvertent reboot loops that cause customers to clog up the support lines and thus cost the company a ton.

3.It really depends on your project. The watchdog is there to help you ensure that your program won't get "stuck" while executing code. -- If there is a chance that your program may hang during the boot-procedure, it may make sense to incorporate the watchdog there too. That being said, I generally start the watchdog at the end of my boot-up procedures.

4.Production code should always enable the watchdog. Hobby and/or prototype projects are obviously a special case that may not require the watchdog.If the watchdog is enabled during boot, there is a special case which must be considered. Erasing and writing memory take a long time (erasing an entire device may take seconds to complete). So you must insure that your erase and write routines periodically service the watchdog to prevent a reset.

There are some contradictions here with answers which i recieved at stackoverflow.I will update,incase i get some more informations on the same.

No comments:

Post a Comment