GPIO_NUM_17 immediatly wakeup from LIGHT SLEEP

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

GPIO_NUM_17 immediatly wakeup from LIGHT SLEEP

Postby davdav » Fri Jun 19, 2020 12:42 pm

Hi everybody,

I'm struggling with light sleep feature. I setup 3 types of sources before going to sleep:

-timer (based on a customer parameter)

Code: Select all

ret = esp_sleep_enable_timer_wakeup(timer_wakeup * 1000000);
ESP_LOGW(TAG_SLEEP, "Enabling TIMER wakeup:%d", ret);
-UART0

Code: Select all

uart_set_wakeup_threshold(UART_NUM_0, 3);
ret = esp_sleep_enable_uart_wakeup(UART_NUM_0);
ESP_LOGW(TAG_SLEEP, "Enabling UART wakeup:%d", ret);
- 4 GPIO

Code: Select all

gpio_wakeup_enable(GPIO_NUM_4, GPIO_INTR_HIGH_LEVEL);
gpio_wakeup_enable(GPIO_NUM_17, GPIO_INTR_HIGH_LEVEL);
gpio_wakeup_enable(GPIO_NUM_5, GPIO_INTR_HIGH_LEVEL);
gpio_wakeup_enable(GPIO_NUM_13, GPIO_INTR_HIGH_LEVEL);
ret = esp_sleep_enable_gpio_wakeup();
ESP_LOGW(TAG_SLEEP, "Enabling GPIO wakeup:%d", ret);
Everything works as expected unless, the "timer wake" and "GPIO_NUM_17" are enabled together. In that case, esp32 exits from sleep immeaditly reporting as cause "ESP_SLEEP_WAKEUP_GPIO". I have checked that GPIO_NUM_17 is low before entering sleep.

If I comment out "GPIO_NUM_17" source, then the problem is solved
OR
on the other side, if I comment "esp_sleep_enable_timer_wakeup" function, the problem is solved as well.


In practice if both otf them are present as source, the light sleep is not performed.. What could be the reason?
I didn't find any restrictions reported in documentation about timer and GPIO sources

Thanks

Who is online

Users browsing this forum: Google [Bot] and 145 guests