Page 2 of 2

Re: esp_sleep_enable_uart_wakeup with CONFIG_CONSOLE_UART_CUSTOM configuration

Posted: Sat Jul 27, 2019 11:58 am
by davdav
WiFive wrote:
Sat Jul 27, 2019 1:27 am
I have tested a simple example and it does work as long as you use the function calls I posted.
Thanks for testing @WiFive. This means my code could have problems.

May I ask you to provide the source code of your test example (and sdkconfig file if possible)? Did you setup the CONFIG_CONSOLE_UART_COSTUM like I originally posted?

I forgot to mention I'm on esp-idf v3.2.2 but I didn't tested on master branch.

Thanks again and regards

Re: esp_sleep_enable_uart_wakeup with CONFIG_CONSOLE_UART_CUSTOM configuration

Posted: Sat Jul 27, 2019 7:32 pm
by WiFive
modified uart example attached

Code: Select all

# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
# CONFIG_ESP_CONSOLE_UART_NONE is not set
# CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0 is not set
CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1=y
CONFIG_ESP_CONSOLE_UART_NUM=1
CONFIG_ESP_CONSOLE_UART_TX_GPIO=19
CONFIG_ESP_CONSOLE_UART_RX_GPIO=5
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200

Re: esp_sleep_enable_uart_wakeup with CONFIG_CONSOLE_UART_CUSTOM configuration

Posted: Sun Jul 28, 2019 9:31 am
by davdav
WiFive wrote:
Sat Jul 27, 2019 7:32 pm
modified uart example attached

Code: Select all

# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
# CONFIG_ESP_CONSOLE_UART_NONE is not set
# CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0 is not set
CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1=y
CONFIG_ESP_CONSOLE_UART_NUM=1
CONFIG_ESP_CONSOLE_UART_TX_GPIO=19
CONFIG_ESP_CONSOLE_UART_RX_GPIO=5
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
Thanks a lot @WiFive,

I will test on my side your example, modifying only the UART_RX_GPIO and UART_TX_GPIO config to reflect our pcb (gpio25 and gpio27) for uart1.

I wish to understand where/what is the wrong part of my code.

Regards

Re: esp_sleep_enable_uart_wakeup with CONFIG_CONSOLE_UART_CUSTOM configuration

Posted: Mon Jul 29, 2019 9:55 am
by davdav
WiFive wrote:
Sat Jul 27, 2019 7:32 pm
modified uart example attached

Code: Select all

# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
# CONFIG_ESP_CONSOLE_UART_NONE is not set
# CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0 is not set
CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1=y
CONFIG_ESP_CONSOLE_UART_NUM=1
CONFIG_ESP_CONSOLE_UART_TX_GPIO=19
CONFIG_ESP_CONSOLE_UART_RX_GPIO=5
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
Hello @WiFive,

I have tested your example and I was able to get it work also in our project. I will add SOLVED to topic.

Thanks for support.

Re: [SOLVED]esp_sleep_enable_uart_wakeup with CONFIG_CONSOLE_UART_CUSTOM configuration

Posted: Sun Jul 24, 2022 4:04 pm
by esp_zag0
Sorry for bumping into an old topic but I have a question that follows along what op & others have discussed couple of years back.

I'd like to use UART wakeup function for communication with an AT command modem. As far as I understood I can't use UART2 at all and UART1 has some limitations (IO9 and IO10 are used for flash so I have to use DIO/DOUT mode instead of QIO/QOUT). This only leaves UART0.

Since UART0 is used for console output I first have to remap it to UART1 with CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 (eg. IO17 and IO16, which I currently use for communication with the modem) and connect the modem to IO1 and IO3.

Does remapping console output to some random IOs and calling it UART1 also uses that pins for flashing the firmware onto ESP32? Are there any limitations compared to 'normal operation', ie. using default GPIOs and UART0?

This is my current GPIO/UART setup:

UART0 (IO1, IO3): console output
UART1 (IO25, IO26): communication with another MCU
UART2 (IO17, IO16): communication with radio modem

Thanks!

Re: [SOLVED]esp_sleep_enable_uart_wakeup with CONFIG_CONSOLE_UART_CUSTOM configuration

Posted: Thu Jul 28, 2022 7:43 pm
by esp_zag0
*BUMP*

Let me shorten the question:

If I switch console output to UART1 instead of UART0 using CONFIG_CONSOLE_UART_CUSTOM and connect the modem to IO1 and IO3, how do I program the MCU? Do I have to route TX and RX from the programmer to both IO0 and IO3 (for flashing) and to UART1 GPIOs (for console output) and simply make sure that the modem is off while I'm flashing the MCU?