Page 1 of 1

(solved) getting a WDT error that doesn't make sense

Posted: Fri Nov 06, 2020 1:07 am
by mzimmers
Hi all -

Since moving to v4.1, I've noticed that occasionally, my units will trigger the WDT. Output is:

Code: Select all

E (21821) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (21821) task_wdt:  - IDLE1 (CPU 1)
E (21821) task_wdt: Tasks currently running:
E (21821) task_wdt: CPU 0: IDLE0
E (21821) task_wdt: CPU 1: Buzzer
E (31821) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (31821) task_wdt:  - IDLE1 (CPU 1)
E (31821) task_wdt: Tasks currently running:
E (31821) task_wdt: CPU 0: IDLE0
E (31821) task_wdt: CPU 1: Buzzer
E (41821) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (41821) task_wdt:  - IDLE1 (CPU 1)
E (41821) task_wdt: Tasks currently running:
E (41821) task_wdt: CPU 0: IDLE0
E (41821) task_wdt: CPU 1: Buzzer
etc...
It isn't always the buzzer task; it's liable to be any of my tasks. It happens when the unit is idle, and I've checked my code for tight loops -- at the end of every event loop, I have a vTaskDelay() for a short period.

Is this some weird configuration error on my part?

I really need to get this sorted out soon; we were hoping to go live with our product next week. So any help would be most appreciated.

Re: getting a WDT error that doesn't make sense

Posted: Sat Nov 07, 2020 5:23 pm
by mzimmers
Any ideas, anyone? My WDT timeout value is set to 10 seconds. I've noticed that it happens most frequently after a restart.

The perplexing aspect is that it's not always the same task; in fact, it appears to be almost random which task it reports as causing the trigger.

Thanks for any suggestions...

Re: getting a WDT error that doesn't make sense

Posted: Sun Nov 08, 2020 10:16 am
by boarchuz
Is there a busy loop in Buzzer and other wdt-triggering tasks? Perhaps in some function common to them all?
Post Buzzer task here?

Re: getting a WDT error that doesn't make sense

Posted: Sun Nov 08, 2020 3:22 pm
by mzimmers
Thank you, boarchuz -- by asking to see the buzzer loop, you caused me to re-inspect my code, and I realized that the buzzer and LED tasks were *not* in fact pausing between iterations. Sloppiness on my part.

I'm not sure the problem is 100% solved, as my Wifi task also triggers the WDT, and it definitely has a pause, but this is progress. Thanks again.

Re: getting a WDT error that doesn't make sense

Posted: Mon Nov 09, 2020 8:47 pm
by mzimmers
I rebuilt my program in debug mode, which gave me a better stack dump. I was able to trace a WDT trigger to a tight loop in the spi_flash subsystem:

https://github.com/espressif/esp-idf/issues/6096

Not sure why something would take so long, or what to do about it, though.

Re: getting a WDT error that doesn't make sense

Posted: Thu Dec 17, 2020 10:32 pm
by mzimmers
It turns out that this was a known issue, and has been fixed in the current version of release/v4.1 (v4.1-520-gc3324a82a). Marking as solved.