ESP32-S2 UART1 as wakeup source in light sleep mode

yusufbavas
Posts: 7
Joined: Mon Mar 01, 2021 11:53 am

ESP32-S2 UART1 as wakeup source in light sleep mode

Postby yusufbavas » Thu Apr 22, 2021 12:57 pm

Hello,

I faced a problem on esp32-s2 light sleep. I can use UART0 as wakeup source but its not working when i try to use UART1. I cant find something like "its only works for UART0". This codes works. When I send some data from UART0, esp wakes up. But when I change it to UART1, its not working. I tried to get data from UART1 without sleep, its works. I can get data from UART1 but esp dont use it as wakeup source. Am I doing something wrong? Thank you. (I use esp-idf-v4.4-dev)

Code: Select all

while (true) {

    uart_set_wakeup_threshold(CONFIG_ESP_CONSOLE_UART_NUM,3);
    esp_sleep_enable_uart_wakeup(CONFIG_ESP_CONSOLE_UART_NUM);

    printf("Entering light sleep\n");
    
    uart_wait_tx_idle_polling(CONFIG_ESP_CONSOLE_UART_NUM);
    uart_wait_tx_idle_polling(CONFIG_ESP_CONSOLE_UART_NUM);
    
    esp_light_sleep_start();

    printf("Returned from light sleep\n");
  }

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32-S2 UART1 as wakeup source in light sleep mode

Postby WiFive » Thu Apr 22, 2021 9:59 pm

You have to use gpio18 as rx and probably manually configure the iomux for that function.

Who is online

Users browsing this forum: No registered users and 133 guests