Page 1 of 1

Serving Watchdog while updating

Posted: Tue Jan 17, 2012 9:00 am
by Musco
Is there a way to service the watchdog, or prevent the watchdog from timing out while using the function ReadS19ApplicationCodeFromStream(int fd) to update the netburner? Using the following code allows the AutoUpdate to function without the watchdog timing out:

watchdog_service_function = KickWatchdog;

This does not service the watchdog while updating using ReadS19ApplicationCodeFromStream though.

Re: Serving Watchdog while updating

Posted: Tue Jan 17, 2012 2:02 pm
by pbreed
Probably have to modify that function.
The source is in nburn\system\streamupdate.cpp

Paul

Re: Serving Watchdog while updating

Posted: Tue Jan 17, 2012 3:29 pm
by lgitlitz
The watchdog_service_function is a call-back function which can trigger a WD service in the middle of the low level flash programming functions ( FlashErase and FlashProgram found in bsp.c). So the watchdog will be serviced anytime on-board flash is written or erased, regardless of the higher level function that calls it... i.e. AutoUpdate, StreamUpdate, Filesystem w/ on-board flash. The main purpose for this callback was to ensure that flash is not damaged due to a WD reset in the middle of a write.

You still need to ensure that you service the watchdog during any other operations performed during the update besides writing flash. Since ReadS19ApplicationCodeFromStream will tie up the task for the network transfer, you can no longer service the WD in this task. Usually I have a "Disable Watchdog" function in my code for this purpose. This does not truly disable the WD, it just enables a low-level task to run that will service the WD in a loop with OSTimeDly(). You do not want this running all the time as it defeats much of the WD purpose but I will turn it on for some unique cases such as this.

-Larry

Re: Serving Watchdog while updating

Posted: Thu Jan 19, 2012 11:01 am
by greengene
i do something like that, larry.
i use tiered watchdogs, software then hardware.
i require my s/w tasks to register and then check-in periodically.
my monitoring task runs at level 37. my h/w watchdog then
affectively becomes an IRQ watchdog.

how many years do we get to do NB develoment before we
get the gold watch? ;)