From ae9041ab712890c0f62db5566e5b1de2ec5f9e2c Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Wed, 30 Aug 2017 13:56:37 +0800 Subject: [PATCH] esp32: Fix task watchdog timer triggering issues TW#14794 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp32/task_wdt.c b/components/esp32/task_wdt.c index eaed32b4ca..ce3f09b839 100644 --- a/components/esp32/task_wdt.c +++ b/components/esp32/task_wdt.c @@ -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); }