diff --git a/components/driver/uart.c b/components/driver/uart.c index 2fc8dbf0bb..fe2a5cc8e7 100644 --- a/components/driver/uart.c +++ b/components/driver/uart.c @@ -631,7 +631,10 @@ esp_err_t uart_param_config(uart_port_t uart_num, const uart_config_t *uart_conf uart_hal_set_tx_idle_num(&(uart_context[uart_num].hal), UART_TX_IDLE_NUM_DEFAULT); uart_hal_set_hw_flow_ctrl(&(uart_context[uart_num].hal), uart_config->flow_ctrl, uart_config->rx_flow_ctrl_thresh); UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); + // The module reset do not reset TX and RX memory. + // reset FIFO to avoid garbage data remained in the FIFO. uart_hal_rxfifo_rst(&(uart_context[uart_num].hal)); + uart_hal_txfifo_rst(&(uart_context[uart_num].hal)); return ESP_OK; }