From 2f499b074dafb9b64b604a85029e4caa61c0a555 Mon Sep 17 00:00:00 2001 From: Song Ruo Jing Date: Mon, 3 Nov 2025 16:14:36 +0800 Subject: [PATCH] fix(uart): fix some uart port generate a RX BRK_DET intr on reset issue Issue saw on S3 UART2 port --- components/driver/uart/uart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/driver/uart/uart.c b/components/driver/uart/uart.c index 241d074863..585a780d9a 100644 --- a/components/driver/uart/uart.c +++ b/components/driver/uart/uart.c @@ -189,6 +189,10 @@ static void uart_module_enable(uart_port_t uart_num) if (uart_context[uart_num].hw_enabled != true) { periph_module_enable(uart_periph_signal[uart_num].module); if (uart_num != CONFIG_ESP_CONSOLE_UART_NUM) { + // Workaround: Set RX signal to high to avoid false RX BRK_DET interrupt raised after register reset + if (uart_context[uart_num].rx_io_num == -1) { + esp_rom_gpio_connect_in_signal(GPIO_MATRIX_CONST_ONE_INPUT, UART_PERIPH_SIGNAL(uart_num, SOC_UART_RX_PIN_IDX), false); + } // Workaround for ESP32C3/S3: enable core reset before enabling uart module clock to prevent uart output // garbage value. #if SOC_UART_REQUIRE_CORE_RESET