Watchdog restart when calling esp_wifi_connect() and mutex's

Kaisha
Posts: 42
Joined: Thu Mar 05, 2020 8:59 pm

Watchdog restart when calling esp_wifi_connect() and mutex's

Postby Kaisha » Fri Jan 14, 2022 10:39 am

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?

Who is online

Users browsing this forum: No registered users and 18 guests