Page 1 of 1

Watchdog restart when calling esp_wifi_connect() and mutex's

Posted: Fri Jan 14, 2022 10:39 am
by Kaisha
I have a weird bug, basically this:

Code: Select all

std::mutex silly_mutex;
{ std::lock_guard<std::mutex> lock{ silly_mutex }; }
esp_wifi_connect();
{ std::lock_guard<std::mutex> lock{ silly_mutex }; }
Will cause a watch-dog timer reset. I don't know what it is, but locking a mutex (any mutex) right after esp_wifi_connect() will hang for a few seconds (even if the call to esp_wifi_connect() would immediately fail under normal circumstances) and then restart. Without the mutex's it will run as expected, connect and run fine. I've even tried putting a vTaskDelay(1) immediately after the esp_wifi_connect() and have had no luck.

Anyone have and ideas on how to fix?