Open MikitaMinau opened 2 years ago
I am also seeing this occasionally on a ESP32-WROVER using automatic light sleep.
this also happens in my application on some modules. I configure pm and enable light sleep in app_main then I start various tasks and also enable wifi in station mode connecting to a remote. it seems like when the wifi connection is established very fast, the reset occurs. if it takes some time for the wifi connection to get up, everything just works fine.
if I disable the wdt in https://github.com/espressif/esp-idf/blob/4c7d97e2bdbd26b1ad6adc6de8051888e1feec10/components/esp_hw_support/sleep_modes.c#L776-L779
by setting wdt_was_enabled = pdTRUE
everything seems to work fine.
If its running on a custom board, you might want to check your matching circuit or configure CONFIG_ESP32_RTC_CLK_CAL_CYCLES
to a higher value, say 8192. I had an issue with a matching circuit and hand solder job that was difficult to pin down. It's what led me to this thread with seemingly random RTCWDT_RTC_RESET
errors.
Edit: After 59 minutes of being connected to ble and ad2p / hfp at the same time, with light sleep enabled, it still crashes here on v4.4.4. I'll have to wait for the next batch of prototypes. I feel like there could be an esp-idf related bug here but need to debug it further.
Edit: So in fact v4.4.4 cannot run BLE & Classic Bluetooth reliably and crash with RTCWDT_RTC_RESET
even with CONFIG_ESP_INT_WDT=n
set. It appears this bug is valid in a sense that, a crash with that message can still occur, even when disabled via sdkconfig / menuconfig
, but it is not the root cause of the issues the op @MikitaMinau is experiencing with regards to BLE / WiFi. The code posted by @bearsh didn't solve the issues for me, and hence ticket #11315.
Environment
Problem Description
Sometimes, I see that ESP32 is reset without any reason. No stack trace is observed during the reset. After the reset, esp_reset_reason() returns 7(ESP_RST_WDT) and rtc_get_reset_reason(PRO_CPU_NUM) returns 16(RTCWDT_RTC_RESET):
Looking into esp-idf source code I came to a conclusion that the reason for the RTC watchdog. However, RTC watchdog is enabled only for bootloader and disabled in the application code(look at attached sdkconfig file).
I suspect automatic light sleep mode because I see that RTC WTD is enabled before going to light sleep but I did find information on haw RTC watchdog is fed in light sleep. Light sleep code says that it enables watchdog in case exit from light sleep fails but did not describe how may it fail:
Expected Behavior
ESP32 is not reset by RTC watchdog when it is disabled.
Actual Behavior
ESP32 is reset by RTC watchdog when it is disabled.
Steps to reproduce
Usually, I see this kind of reset within 12-24 hours of work. BLE and WiFi are enabled. Automatic light sleep and DFS are also enabled.
Code to reproduce this issue
Unfortunately, I cannot share the code (also, it requires custom HW and won't run on devkits).
Debug Logs
Other items if possible
sdkconfig.txt