Task watchdog got triggered with WiFi and Bluetooth in the same time

s.allasia
Posts: 23
Joined: Tue Jan 09, 2018 3:12 pm

Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby s.allasia » Thu Sep 20, 2018 7:23 am

Hi,
I'm working on IoT project based on ESP32-WROOM32.
The system must work simultaneously with WiFi and Bluetooth.
Now the device execute this sequence:

1) init NVM
2) init BLE in client mode
3) start scan BLE
4) init WiFi
5) connect to AP of my WiFi router
6) get timestamp
7) connect to IoT service of Google Cloud by MQTT

All works fine rx BLE and tx/rx WiFi but after a few minutes ESP32 said:

Task watchdog got triggered. The following tasks did not reset the watchdog in time:
- IDLE (CPU 0)
Tasks currently running:
CPU 0: wifi
CPU 1: IDLE
Task watchdog got triggered. The following tasks did not reset the watchdog in time:
- IDLE (CPU 0)
Tasks currently running:
CPU 0: wifi
CPU 1: IDLE
Task watchdog got triggered. The following tasks did not reset the watchdog in time:
- IDLE (CPU 0)
Tasks currently running:
CPU 0: wifi
CPU 1: IDLE

Repeats this message endless times.
WiFi and Bluetooth don't work anymore.

What I can do?
Thank you

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby vonnieda » Thu Sep 20, 2018 4:33 pm


s.allasia
Posts: 23
Joined: Tue Jan 09, 2018 3:12 pm

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby s.allasia » Fri Sep 21, 2018 5:45 am

Hi vonnieda,
I checked: yes It's the same thing!
Do you have any answer?

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby davdav » Fri Sep 21, 2018 1:21 pm

Task watchdog got triggered. The following tasks did not reset the watchdog in time:
- IDLE (CPU 0)
Tasks currently running:
CPU 0: wifi
CPU 1: IDLE
I have a side question: I get also this warning I realize that if I invoke "esp_restart()" API it doesn't work.

Since "wifi" task is out of our control, is it possible to automatically reboot the esp32 when a task watchdog triggers?

s.allasia
Posts: 23
Joined: Tue Jan 09, 2018 3:12 pm

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby s.allasia » Fri Sep 21, 2018 1:25 pm

Hi davdav,
Yes, you can.
You must enable panic when WDT happen via menuconfig:
make menuconfig --> Component config --> ESP32-specific --> Invoke panic handler on Task Watchdog timeout

Bye

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby davdav » Fri Sep 21, 2018 2:04 pm

You must enable panic when WDT happen via menuconfig:
make menuconfig --> Component config --> ESP32-specific --> Invoke panic handler on Task Watchdog timeout
Thnaks s.allasia,

If you enable panic handler the device will be stuck to let you debug (for example via GDB stub) or the device will silently reboot?

Or the behaviour is decided by "make menuconfig --> Component config --> ESP32-specific --> Panic handler behaviour"?

Obviuosly it would be better if a "system task" like "wifi" doesn't trigger the watchdog timeout.

Thanks

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby fly135 » Fri Sep 21, 2018 3:00 pm

davdav wrote:I have a side question: I get also this warning I realize that if I invoke "esp_restart()" API it doesn't work.
Oh crap! I've seen it hang the app with wifi like that and my solution was a WD task that called esp_restart. So this isn't good news.

Can anyone confirm that the IDF WD set to panic will work correctly in this situation?

John A

s.allasia
Posts: 23
Joined: Tue Jan 09, 2018 3:12 pm

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby s.allasia » Fri Sep 21, 2018 3:28 pm

Hi davdav,
If you enable panic when WDT happen via menuconfig, the behaviour is decided by "make menuconfig --> Component config --> ESP32-specific --> Panic handler behaviour".

If you want disable watchdog, you must disable "Initialize Task Watchdog Timer on startup" (not recommended).

s.allasia
Posts: 23
Joined: Tue Jan 09, 2018 3:12 pm

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby s.allasia » Fri Sep 21, 2018 3:38 pm

Hi fly135,
If a task watchdog triggers it's very probably that calls to functions don't work, "Panic handler behaviour" works instead.

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Task watchdog got triggered with WiFi and Bluetooth in the same time

Postby fly135 » Fri Sep 21, 2018 8:59 pm

s.allasia wrote:Hi fly135,
If a task watchdog triggers it's very probably that calls to functions don't work, "Panic handler behaviour" works instead.
I don't find that to be true at all. I get task WD triggers every time I OTA. Erasing the flash causes them. However I don't have the panic handler enabled, so those WD triggers don't actually affect anything. I have my own WD tasks (1 for each core) that are simply task loops that set a flag then delay. Each task has a timer that executes and checks the flags every 2 minutes and calls esp_restart if the flag haven't been set by the task.

But it's starting to look like I'm going to need to set up the IDF watchdog to handle this is wifi task hanging disables esp_restart. I'm not convinced it does though. The reason being that when the wifi task hung in my app it appeared that the APP core was still working.

John A

Who is online

Users browsing this forum: ericchile and 117 guests