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

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

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

Postby mzimmers » Fri Nov 06, 2020 1:07 am

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.
Last edited by mzimmers on Thu Dec 17, 2020 10:32 pm, edited 1 time in total.

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

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

Postby mzimmers » Sat Nov 07, 2020 5:23 pm

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...

boarchuz
Posts: 566
Joined: Tue Aug 21, 2018 5:28 am

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

Postby boarchuz » Sun Nov 08, 2020 10:16 am

Is there a busy loop in Buzzer and other wdt-triggering tasks? Perhaps in some function common to them all?
Post Buzzer task here?

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

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

Postby mzimmers » Sun Nov 08, 2020 3:22 pm

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.

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

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

Postby mzimmers » Mon Nov 09, 2020 8:47 pm

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.

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

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

Postby mzimmers » Thu Dec 17, 2020 10:32 pm

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.

Who is online

Users browsing this forum: No registered users and 135 guests