Page 1 of 1

User UART0 for LOG and UART1 for comms in ESP32S3

Posted: Tue Nov 18, 2025 10:28 pm
by ihouses
Hi,

I want use UAR0 for LOGs and UART1 for other comms in Esp32S3. Uart1 will be connected to GPIO0 (TX) and GPIO1 (RX), the code looks something like this:

#include "driver/uart.h"
#include "esp_log.h"

#define UART_COMM_NUM UART_NUM_1
#define UART_COMM_TXD 0
#define UART_COMM_RXD 1
#define UART_COMM_BAUDRATE 115200
#define UART_COMM_BUF_SIZE 1024

void app_main(void)
{
// Configure UART1 parameters
uart_config_t uart_config = {
.baud_rate = UART_COMM_BAUDRATE,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
};
uart_param_config(UART_COMM_NUM, &uart_config);

// Set UART1 pins: TX=GPIO0, RX=GPIO1
uart_set_pin(UART_COMM_NUM, UART_COMM_TXD, UART_COMM_RXD, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);

// Install UART1 driver
uart_driver_install(UART_COMM_NUM, UART_COMM_BUF_SIZE, UART_COMM_BUF_SIZE, 0, NULL, 0);

// Example: Send a message over UART1
const char* test_str = "Hello from UART1!\r\n";
uart_write_bytes(UART_COMM_NUM, test_str, strlen(test_str));

// UART0 will continue to output logs as usual
ESP_LOGI("UART", "UART0 is used for logs, UART1 is used for communication on GPIO0/1");
}


The point is: I see the LOG coming out at GPIO0, 1, what is happening?

Ideally I would like to see the LOG showing up in a USB C connector (the same that I use for programming the ESP32S3)
and the other UART communication (UART1) in GPIO0,1, but looks like there is some conflict between UART0 and 1, is that possible?

Re: User UART0 for LOG and UART1 for comms in ESP32S3

Posted: Wed Nov 19, 2025 3:26 am
by nopnop2002
Here is official example.

https://github.com/espressif/esp-idf/tr ... _rxtxtasks

GPIO is specified in menuconfig.

Re: User UART0 for LOG and UART1 for comms in ESP32S3

Posted: Wed Nov 19, 2025 8:02 am
by ihouses
My bad, UART0 in my board was not connected to GPIO 0,1 but default GPIOs 43, 44 :(
Thanks for the hint.