Cant wake up from UART_NUM_1

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

Re: Cant wake up from UART_NUM_1

Postby WiFive » Sat Feb 29, 2020 2:25 am

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.

JosuGZ
Posts: 48
Joined: Tue Jan 14, 2020 9:47 am

Re: Cant wake up from UART_NUM_1

Postby JosuGZ » Mon Mar 02, 2020 8:13 am

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.

timmbo
Posts: 30
Joined: Fri Jan 03, 2020 11:43 am

Re: Cant wake up from UART_NUM_1

Postby timmbo » Mon Nov 30, 2020 6:27 pm

WiFive wrote:
Mon Jan 20, 2020 11:14 pm
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.

timmbo
Posts: 30
Joined: Fri Jan 03, 2020 11:43 am

Re: Cant wake up from UART_NUM_1

Postby timmbo » Wed Dec 09, 2020 5:01 pm

timmbo wrote:
Mon Nov 30, 2020 6:27 pm
WiFive wrote:
Mon Jan 20, 2020 11:14 pm
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.

Who is online

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