Page 2 of 2

Re: Cant wake up from UART_NUM_1

Posted: Sat Feb 29, 2020 2:25 am
by WiFive
I think you will always lose the first packet when waking up, even when using gpio3. The uart fifo is not available in sleep to save the bytes.

Re: Cant wake up from UART_NUM_1

Posted: Mon Mar 02, 2020 8:13 am
by JosuGZ
I was losing a lot of bytes, not only the first one. I suspect the reason was that the chip would wake up and then immediately sleep, and after a bunch of things I have to sort now (involving locking sleep on the interrupt), it is working. But I'm not sure how I should do this correctly.

Re: Cant wake up from UART_NUM_1

Posted: Mon Nov 30, 2020 6:27 pm
by timmbo
Did you set the mux for gpio9 to uart1 rx
Hey there, I know the thread is some months old, but I have the same problem. Can you please give us a hint on how to set mux for gpio 9 to uart1 rx? For UART0 everything works fine, also the wake up, but for UART1 it does not work:

Code: Select all

//gpio_iomux_in(GPIO_NUM_9, U1RXD_IN_IDX);
//gpio_iomux_out(GPIO_NUM_9, 5, false);
uart_set_wakeup_threshold(1, 3);
esp_sleep_enable_uart_wakeup(1);
Also doesn't work with the gpio_iomux_in and out functions.

Re: Cant wake up from UART_NUM_1

Posted: Wed Dec 09, 2020 5:01 pm
by timmbo
Did you set the mux for gpio9 to uart1 rx
Hey there, I know the thread is some months old, but I have the same problem. Can you please give us a hint on how to set mux for gpio 9 to uart1 rx? For UART0 everything works fine, also the wake up, but for UART1 it does not work:

Code: Select all

//gpio_iomux_in(GPIO_NUM_9, U1RXD_IN_IDX);
//gpio_iomux_out(GPIO_NUM_9, 5, false);
uart_set_wakeup_threshold(1, 3);
esp_sleep_enable_uart_wakeup(1);
Also doesn't work with the gpio_iomux_in and out functions.
Would anybody be so kind to help? I tried pretty much everything to wake up on UART_NUM_1. Wake up by gpio_wakeup_enable works fine. That is my code:

Code: Select all

PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA2_U, FUNC_SD_DATA2_U1RXD); // GPIO9 should be configured as function_5
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA3_U, FUNC_SD_DATA3_U1TXD);
if(uart_set_wakeup_threshold(1, 3) != ESP_OK) { printf("ERROR10\n"); }
if(esp_sleep_enable_uart_wakeup(1) != ESP_OK) { printf("ERROR11\n"); }
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); // +1uA, internal pull-ups and pull-downs and ULP
esp_light_sleep_start();
It is simply not waking up and the documentation lacks any further information.