From 8fc6b4493bdc2fa96791aeaea905576a4a9e3393 Mon Sep 17 00:00:00 2001 From: Marcio Ribeiro Date: Fri, 13 Dec 2024 10:13:22 -0300 Subject: [PATCH] drivers: uart: esp32: reset tx fifo during driver init Resets uart tx fifo during driver initialization to have a well defined initial condition mainly preventing unwanted characters being sent Signed-off-by: Marcio Ribeiro (cherry picked from commit f0516ead27f8af52463b68348588622f374292a0) --- drivers/serial/uart_esp32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/serial/uart_esp32.c b/drivers/serial/uart_esp32.c index 9ea0d67252c1de..0c1e5bcb51bbdc 100644 --- a/drivers/serial/uart_esp32.c +++ b/drivers/serial/uart_esp32.c @@ -267,6 +267,7 @@ static int uart_esp32_configure(const struct device *dev, const struct uart_conf uart_hal_set_rxfifo_full_thr(&data->hal, UART_RX_FIFO_THRESH); uart_hal_set_txfifo_empty_thr(&data->hal, UART_TX_FIFO_THRESH); uart_hal_rxfifo_rst(&data->hal); + uart_hal_txfifo_rst(&data->hal); switch (cfg->parity) { case UART_CFG_PARITY_NONE: