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);
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);
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);
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