WDT operation in ESP32


I have a tight loop that does 20000 writes of 16 characters each from EPS32 memory to ESP32 file. This operation usually completes in 17 seconds. Occasionally, it crashes (especially when the filespace is almost full).

The crash message is:

←[0;31mE (400224) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:←[0m

  • mgos (CPU 0), backtrace: 0x4000bff0 0x4008dd4d 0x4008d141 0x4008d236 0x400830af 0x400e960f 0x400eca5d 0x4018d2a5 0x400eeb2a 0x400ef119 0x400f0ccd 0x400ef76d 0x400ec67c 0x400e8e7c 0x400e11b5 0x4000bd83 0x4000117d 0x400592fe 0x4005937a 0x40058ad3 0x400d217d 0x400d21a4 0x400e681d 0x400f4319 0x400f87fa 0x400fac0e 0x400fba61 0x400fbc69 0x400fbdd7 0x400fe2b2 0x400fd61a 0x400fd7d4 0x400fe085 0x400fe51a 0x40179e32 0x4017a717 0x4017ae46 0x4017aea5 0x40179e32 0x4017b14a 0x4017d799 0x4017d7cb 0x4018f10d 0x4017634d 0x40082fe2 0x400831ba
    ←[0;31mE (400224) task_wdt: Tasks currently running:←[0m
    ←[0;31mE (400224) task_wdt: CPU 0: mgos←[0m
    ←[0;31mE (400224) task_wdt: Aborting.←[0m
    abort() was called at PC 0x400d0d84 on core 0

I am looking for some background information on WDT operation for ESP32 and Mongoose.

  1. Is (and if so, how is) the mgos_wdt_enable (and associated commands) connected to the ESP32 Task WDT?
  2. Where can you get source for the HAL for ESP32?

Thanks for your help,



Try mgos_wdt_feed()


This and the subsequent “Who feeds the dog?” thread is exactly what I need.