Page 2 of 2

Re: Crash when waking up from light sleep

Posted: Wed Oct 11, 2017 9:38 am
by colman
Does esp32 idf support light sleep mode? The compiler reports error as below:

error: implicit declaration of function 'esp_sleep_enable_timer_wakeup' [-Werror=implicit-function-declaration]
esp_sleep_enable_timer_wakeup(1000000);
^
error: implicit declaration of function 'esp_light_sleep_start' [-Werror=implicit-function-declaration]
int ret = esp_light_sleep_start();
^

Which idf version you are talking about?

Colman

Re: Crash when waking up from light sleep

Posted: Thu Oct 12, 2017 3:12 am
by ESP_igrr
If you use master branch (v3.0-dev) of ESP-IDF, you should be able to use light sleep. Make sure you have #include "esp_sleep.h" in your source file.
The fix for the bug mentioned earlier in this topic (light sleep not working in Release builds) has not been merged yet, but if you run into this, you can apply the fix locally — it's a one line change.