esp_task_wdt_feed() wdt feed error

CharlesSeartech
Posts: 19
Joined: Fri Oct 06, 2017 10:27 am

esp_task_wdt_feed() wdt feed error

Postby CharlesSeartech » Tue Oct 10, 2017 10:35 am

Hello,

In the esp_task_wdt_feed() function there is an error in that the last task added to the list never gets checked as it's fed_watchdog flag is never cleared. When "for (wdttask=wdt_task_list;" is searching through the list it exits when "wdttask->next!=NULL;" which means that the last task in the list never gets it's fed_watchdog flag reset as the last task in the list will always have it's wdttask->next set to NULL!

if (do_feed_wdt) {
//All tasks have checked in; time to feed the hw watchdog.
TIMERG0.wdt_wprotect=TIMG_WDT_WKEY_VALUE;
TIMERG0.wdt_feed=1;
TIMERG0.wdt_wprotect=0;
//Reset fed_watchdog status
//for (wdttask=wdt_task_list; wdttask->next!=NULL; wdttask=wdttask->next) wdttask->fed_watchdog=false;
// Bug fix, end search when wdttask!=NULL
for (wdttask=wdt_task_list; wdttask!=NULL; wdttask=wdttask->next) wdttask->fed_watchdog=false;
}

Regards,
Charles

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: esp_task_wdt_feed() wdt feed error

Postby ESP_Sprite » Wed Oct 11, 2017 2:44 am

Thanks for mentioning this. We are aware of this issue and it'll be fixed in a MR that overhauls the entire watchdog code slightly; should be coming into master shortly.

Who is online

Users browsing this forum: No registered users and 25 guests