Hi,
i have an issue with my ESP32 concerning the watchdog. Sometimes i get this error and the ESP32 restarts. The message i get is this one:
[D][BLEAdvertisedDevice.cpp:247] pE (17446) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (17446) task_wdt: - IDLE0 (CPU 0)
E (17446) task_wdt: Tasks currently running:
E (17446) task_wdt: CPU 0: Btc_task
E (17446) task_wdt: CPU 1: IDLE1
E (17446) task_wdt: Aborting.
abort() was called at PC 0x400e37d3 on core 0
How can i resolve this problem ?
I'm using the PlatformIo and arduino Framework.
Best regards,
Please follow the issue template. It allows you to help us fix YOUR problem. The task watchdog gets triggered when your code blocks the OS from switching tasks.
Hi Ibernstone,
Sorry for the late response. Here the informations asked :
Hardware :
Board: TTGO T-Call, other ESP32 Dev Modules
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash, PSRAM Disabled, Upload Speed=921600, Flash Frequency=80Mhz
Environment: Arduino, PlatformIO (framework-arduinoespressif32 3.10004.200129 (1.0.4))
Computer OS: Windows
Description:
I鈥檓 implementing a simple ESP32 BLE device that do a BLE scan. In the advertised callback, I test if I find the UUID I鈥檓 looking for, when it鈥檚 found, I print it on the Serial port. The scan is done in continuous mode.
The problem I have that almost every hour my ESP32 restarts.
below a snippet of the code used:
`void initClient()
{
//Starting Arduino BLE Client application
BLEDevice::init("");
// have detected a new device. Specify that we want active scanning and start the
pBLEScan = BLEDevice::getScan();
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks(), true);
pBLEScan->setActiveScan(true);
pBLEScan->start(50, scanCompleteCB);
}
`
Debug Messages:
[D][BLEAdvertisedDevice.cpp:247] pE (17446) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (17446) task_wdt: - IDLE0 (CPU 0)
E (17446) task_wdt: Tasks currently running:
E (17446) task_wdt: CPU 0: Btc_task
E (17446) task_wdt: CPU 1: IDLE1
E (17446) task_wdt: Aborting.
abort() was called at PC 0x400e37d3 on core 0
Best Regards,
You need to add a delay() wherever your code is blocking for too long. Since you did not post any code, I can only guess it is in your callback.
Thanks,
My code is very huge, i only give the part the causes the problem. I comment all part an let the BLE part. This problem produced in the callback indeed, because when it restarts, i have a serial print coming from this callback.
You suggest to a delay inside the callback ? it will penalize the BLE scanning, i will have less advertisement informations.
Best regards,
A delay(1) is typically used to allow other processes to have some cpu time.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/wdts.html#task-watchdog-timer
Ok thank you, i'll try this and let you know.
Best regards,
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
Most helpful comment
You need to add a delay() wherever your code is blocking for too long. Since you did not post any code, I can only guess it is in your callback.