Open owen63 opened 2 months ago
Bug happens 1 in 10 times when woken from deep sleep by IO pin. Flash and nvs are encrypted. Minimal reproducible code is:
extern "C" void app_main(void)
{
// Restore RTC wakeup pins to GPIO
rtc_gpio_deinit(GPIO_NUM_6);
// Initialise nvram partition
// WATCHDOG TIMEOUT HERE SOMETIMES AFTER WAKE FROM SLEEP
nvs_flash_init();
// Configure wakeup io pin
gpio_reset_pin(GPIO_NUM_6);
gpio_set_direction(GPIO_NUM_6, GPIO_MODE_INPUT);
gpio_set_pull_mode(GPIO_NUM_6, GPIO_PULLDOWN_ONLY);
gpio_set_intr_type(GPIO_NUM_6, GPIO_INTR_ANYEDGE);
// Back to sleep
uint64_t wakeup_mask = (1UL << GPIO_NUM_6);
// Reduce deep sleep current
rtc_gpio_isolate(GPIO_NUM_6);
esp_sleep_enable_ext1_wakeup(wakeup_mask, ESP_EXT1_WAKEUP_ANY_HIGH);
ESP_LOGI(TAG, "zzz");
esp_deep_sleep_start();
}
Not reproducible after these steps:
Working on reproducing it...
Hi @owen63, were you able to create a reproducible application? I tried the above code snippet but it was not reproducible on my side as well.
Answers checklist.
IDF version.
v5.2.1
Espressif SoC revision.
ESP32-S3 v0.2
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
CMD
Development Kit.
Custom Board
Power Supply used.
External 3.3V
What is the expected behavior?
nvs_flash_init() should not cause watchdog timeout
What is the actual behavior?
nvs_flash_init() intermittently causes watchdog timeout
Steps to reproduce.
Debug Logs.
More Information.
This has occurred unexpectedly on one device. Am not yet in a position to test on many devices but have not seen this behaviour on my main test board. It happens intermittently. It seems unlikely to be a chip issue but can't replicate it on other chips. It is nvs_flash_init() on encrypted nvs partition. Startup code is:
`extern "C" void app_main(void) {
if CONFIG_RESTART_DEBUG_INFO
`