Page 1 of 1

esp_task_wdt_feed() wdt feed error

Posted: Tue Oct 10, 2017 10:35 am
by CharlesSeartech
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

Re: esp_task_wdt_feed() wdt feed error

Posted: Wed Oct 11, 2017 2:44 am
by ESP_Sprite
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.