Uart Q&A

Q: After configuring Uart1 mode and updating the kernel, the uart1 function does not take effect?

First consider the function reuse. It is found that PAD_UART1_RX is used elsewhere in the dts file. It is recommended that users search for keywords to exclude.

Q2: Which pins can be configured in Uart modes?

Configure in *_padmux.dtsi corresponding to the kernel.

Fuart with flow control, use MODE1, the default baud is 9600.

<PAD_FUART_RX PINMUX_FOR_FUART_MODE_1 MDRV_PUSE_FUART_RX>,
<PAD_FUART_TX PINMUX_FOR_FUART_MODE_1 MDRV_PUSE_FUART_TX>,
<PAD_FUART_CTS PINMUX_FOR_FUART_MODE_1 MDRV_PUSE_FUART_CTS>,
<PAD_FUART_RTS PINMUX_FOR_FUART_MODE_1 MDRV_PUSE_FUART_RTS>,

Fuart without flow control, uses MODE2, and the default baud is 9600 // /dev/ttyS2

<PAD_FUART_RX PINMUX_FOR_FUART_MODE_2 MDRV_PUSE_FUART_RX>,
<PAD_FUART_TX PINMUX_FOR_FUART_MODE_2 MDRV_PUSE_FUART_TX>,

uart0: the default baud is 115200 // /dev/ttyS0

<PM_UART_RX PINMUX_FOR_UART0_MODE_1 MDRV_PUSE_UART0_RX >,
<PM_UART_TX PINMUX_FOR_UART0_MODE_1 MDRV_PUSE_UART0_TX >,

uart1: the default baud is 9600 // /dev/ttyS1

<PAD_UART1_RX PINMUX_FOR_UART1_MODE_1 MDRV_PUSE_UART1_RX>,
<PAD_UART1_TX PINMUX_FOR_UART1_MODE_1 MDRV_PUSE_UART1_TX>,

uart2: the default baud is 9600 // /dev/ttyS3

<PAD_GPIO8 PINMUX_FOR_UART2_MODE_2 MDRV_PUSE_UART2_RX>,
<PAD_GPIO9 PINMUX_FOR_UART2_MODE_2 MDRV_PUSE_UART2_TX>,

Q3: After configuring the Uart1 mode as shown in the figure below and updating the kernel, the uart1 function does not take effect.

First consider the impact of function reuse; this case is caused by multiple uses of PAD_UART1_RX in the dts file.

Please search for keywords for preliminary investigation.

Q4: During the power-on process, uart1 cannot receive data, but the data is sent to uart1's RX.

Data cannot be received due to unsuccessful setting of the underlying baud. You can modify the default baud of the serial port as needed, kernel/drivers/tty/serial/serial_core.c

![](mymedia/uart/uart3.png)

Q5: The serial port log has matched RX/TX, but there is no output.

The serial port tool sets the baud to 115200 (uart0 default value), the data bit is set to 8, and the parity check is disabled. In addition, please disable the flow control of the serial port tool.