esp_task_wdt_feed() wdt feed error
Posted: 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
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