View Single Post
  #10   Spotlight this post!  
Unread 07-03-2010, 12:56
bronxbomber92 bronxbomber92 is offline
Registered User
FRC #1551 (Grapes of Wrath)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Naples
Posts: 75
bronxbomber92 is an unknown quantity at this point
Re: Watchdog not fed

Quote:
Originally Posted by pfreivald View Post
I don't know if this is useful at this point, but after struggling with watchdog issues throughout the build season, we corrected it by putting a 5 ms wait statement in our main loop. That cured the problem instantly, and it didn't come back.

(I'm not at all a programmer, but I know that's what they did, so I thought I'd share it here. Good luck teams!)

Patrick
I'll expand upon what we did :-)

We were experiencing system level watchdog "not fed" errors. For awhile we couldn't figure out what exactly was happening except that it had to do with the camera feed on the dashboard. It turned out that we were starving the background task/thread that was responsible for serving the dashboard with the camera image packets by hogging CPU time with our main task/thread (the thread that OperatorControl() runs within). This affected our communication between our driver station and cRIO, effectively timing-out the watchdog that monitored communication.

The fix was to suspend the main thread for 5/100 of a second, thus giving other threads (ie, the camera feed thread) more time to execute.
Code:
void OperatorControl() {
    while(IsOperatorControl()) {
        ... do you own work ..
        .. then at the end of the loop, suspend the task ..
        Wait(0.05f);
    }
}

Last edited by bronxbomber92 : 07-03-2010 at 14:15.
Reply With Quote