Serving Watchdog while updating

Discussion to talk about software related topics only.
Post Reply
Musco
Posts: 13
Joined: Wed Oct 12, 2011 10:36 am

Serving Watchdog while updating

Post 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.
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: Serving Watchdog while updating

Post by pbreed »

Probably have to modify that function.
The source is in nburn\system\streamupdate.cpp

Paul
User avatar
lgitlitz
Posts: 331
Joined: Wed Apr 23, 2008 11:43 am
Location: San Diego, CA
Contact:

Re: Serving Watchdog while updating

Post 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
greengene
Posts: 164
Joined: Wed May 14, 2008 11:20 am
Location: Lakeside, CA

Re: Serving Watchdog while updating

Post 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? ;)
Post Reply