Serial Communication
1. Serial Pins
Serial pin correspondence (taking M5-R1 as an example):
| Serial | Pin | Function |
|---|---|---|
| TXD | 8 | Transmit signal line |
| RXD | 10 | Receive signal line |
Corresponds to UART3 on the board's 40PIN.

2. Check Serial Device
Check if the serial device is generated.
# Execute command to check serial device
ls /dev/ttyS*As shown in the figure, ttyS3 is UART3, and ttyS8 is UART8 (this serial port is occupied by the Bluetooth module).
3. Serial Communication Testing
Taking M5-R1 as an example, connect to PC via USB-to-serial device for serial testing.
3.1 Connect Serial Port
Connect the TX and RX of the USB-to-serial device to UART6_RX and UART6_TX on the 40PIN respectively.
USB-to-TTL serial device as shown:

- TXD -- RXD
- RXD -- TXD
- GND -- GND
3.2 Query Serial Port Parameters and Modify Baud Rate
Use stty tool to query serial port parameters.
# Execute the following command on the board's terminal
root@rk3588-buildroot:/# stty -F /dev/ttyS6
speed 9600 baud; line = 0;
-brkint -imaxbel
root@rk3588-buildroot:/#Use stty tool to modify serial port parameters.
# Set communication speed, where ispeed is input speed and ospeed is output speed
root@rk3588-buildroot:/# stty -F /dev/ttyS6 ispeed 115200 ospeed 115200
root@rk3588-buildroot:/# stty -F /dev/ttyS6
speed 115200 baud; line = 0;
-brkint -imaxbel
root@rk3588-buildroot:/#Warning
The baud rate needs to be reset after each device boot. Restart will reset the baud rate to 9600 by default.
3.3 Communicate with PC
After configuring the serial debugging assistant on the PC side, use the following command on the board side to test serial data transmission:
# Execute the following command on the board's terminal
# Use echo command to write strings "Hello!" and "Linux6_1!" to the terminal device file
echo Hello! > /dev/ttyS6
echo "Linux6_1" > /dev/ttyS6
# The serial debugging assistant on the PC will receive the contentTo test receiving data, you can use the microcom tool:
# Execute the following command on the board's terminal
# Use microcom command to read terminal device file, -s parameter can set baud rate
microcom -s 115200 /dev/ttyS6
# The microcom command will wait
# Use serial debugging assistant to send strings
# The board's terminal will output the received content