]> granicus.if.org Git - esp-idf/commitdiff
esp32: Fix task watchdog timer triggering issues TW#14794
authorDarian Leung <darian@espressif.com>
Wed, 30 Aug 2017 05:56:37 +0000 (13:56 +0800)
committerDarian Leung <darian@espressif.com>
Fri, 29 Sep 2017 14:12:58 +0000 (22:12 +0800)
The two task watchdog timer bugs are as follows...
1) If only a single task existed on the wdt task list, and esp_task_wdt_feed()
was only called once, the watchdog triggers but fails to print task name
2) If a single task already exists on the task wdt list, and another task calls
esp_task_wdt_feed() once, the watchdog fails to trigger

Problem stemmed from the loop responsible for resetting the watchdog timer
having incorrect loop parameters. The loop failed to traverse the full length
of the task wdt list

components/esp32/task_wdt.c

index eaed32b4caf51bb7cb011292922b739ae96b032e..ce3f09b8393a462abb17cbdd1bbde88cde94bc98 100644 (file)
@@ -131,7 +131,7 @@ void esp_task_wdt_feed() {
         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;
+        for (wdttask=wdt_task_list; wdttask!=NULL; wdttask=wdttask->next) wdttask->fed_watchdog=false;
     }
     portEXIT_CRITICAL(&taskwdt_spinlock);
 }