ESP32 Watchdog Timer Causes Random Resets
DodaTech
Updated 2026-06-26
1 min read
In this tutorial, you'll learn about ESP32 Watchdog Timer Causes Random Resets. We cover key concepts, practical examples, and best practices.
The Problem
ESP32 resets randomly due to the Interrupt Watchdog Timer (IWDT) or Task Watchdog Timer (TWDT).
Quick Fix
Wrong
// Default watchdog enabled. Long operations trigger reset.
ESP32 resets during long Serial.print() or network operations.
Right
void setup() {
disableCore0WDT(); // Disable WDT on core 0
disableCore1WDT(); // Disable WDT on core 1
// OR feed the WDT during long operations:
for (int i = 0; i < 1000000; i++) {
feedWatchdog();
// do work
}
}
No more random resets. Long operations complete successfully.
Prevention
Feed watchdog during long loops. Use esp_task_wdt_reset() to feed TWDT. Disable ISR watchdog for debug builds. Set longer timeouts for slow operations. Handle WDT in FreeRTOS idle hook.
DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro