View the Linux native serial port

1. Check whether the serial port is available, you can send data to the serial port, such as com1 port

echo /dev/ttyS0

2. View the serial port name usage

ls -l /dev/ttyS*

Under normal circumstances, the names of the serial ports are all under dev. If there is no external serial port card, the default is ttyS* under dev. Generally, ttyS0 corresponds to com1, and ttyS1 corresponds to com2. Of course, it is not necessarily necessary;

3. View the serial driver

cat/proc/tty/drivers/serial

4. View the serial device

dmesg | grep ttyS*

5. Check whether there is any device on the serial port on the development board

grep tty/proc/devices

Guess you like

Origin blog.csdn.net/sinat_33101665/article/details/128938446