From a398f415f09c928410c67159b403f454e09df65d Mon Sep 17 00:00:00 2001 From: Austin T Conn Date: Sun, 30 Aug 2026 11:43:42 -0400 Subject: [PATCH] Remove broken esp_task_wdt_reset() call on ESP32 The ESP32 branch of init_pins() calls esp_task_wdt_reset() unconditionally, assuming the Arduino main loop task is auto-registered with the task watchdog. That's true on older ESP32 Arduino cores but not on modern IDF5-based cores (tested against esp32:esp32 3.3.11) -- every call fails with 'task_wdt: esp_task_wdt_reset(707): task not found'. Since init_pins() runs deep inside scan()'s nested pin-permutation loop (up to thousands of times per scan), the failed calls flood the serial log and burn enough time that the real hardware watchdog fires, crash-looping the board instead of ever completing a scan. Confirmed as a firmware bug, not a wiring/target issue -- reproduces identically with no target connected. Removed the call entirely rather than chase the newer core's esp_task_wdt_add() registration API, since this is a bench tool driven interactively and doesn't need automatic watchdog-based crash recovery. --- JTAGenum.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/JTAGenum.ino b/JTAGenum.ino index 387d19a..0321dd0 100644 --- a/JTAGenum.ino +++ b/JTAGenum.ino @@ -254,9 +254,7 @@ byte pulse_tdo(int tck, int tdo) */ void init_pins(int tck = IGNOREPIN, int tms = IGNOREPIN, int tdi = IGNOREPIN, int ntrst = IGNOREPIN) { -#if defined(ESP32) - esp_task_wdt_reset(); //reset timer (feed watchdog) -#elif defined(ESP8266) || defined(ESP_H) +#if defined(ESP8266) || defined(ESP_H) ESP.wdtFeed(); //feed watchdog #endif // default all to INPUT state