ECM_5412@chenfl:~$ dmesg | grep tty [ 0.000000] console [tty0] enabled [ 2.511678] 00:08: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A // dmesg 是系统启动的信息显示。 // 显示中断号, 默认波特率
再利用 setserial 进行查看当前的串口的信息
// 一般 Linux 系统不会默认安装 setserial 命令 // ubuntu 里面是 sudo apt-get install setserial // rethat , centos 里面是 sudo yum install setserial
ECM_5412@chenfl:~$ sudo setserial -g /dev/ttyS[0123] /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 // 利用 setserial 也可以设置串口属性
sudo cat /proc/tty/driver/serial serinfo:1.0 driver revision: 0: uart:16550A port:000003F8 irq:4 tx:0 rx:0 CTS|DSR|CD 1: uart:unknown port:000002F8 irq:3 2: uart:unknown port:000003E8 irq:4 3: uart:unknown port:000002E8 irq:3 4: uart:unknown port:00000000 irq:0 5: uart:unknown port:00000000 irq:0 6: uart:unknown port:00000000 irq:0 7: uart:unknown port:00000000 irq:0 8: uart:unknown port:00000000 irq:0 9: uart:unknown port:00000000 irq:0 10: uart:unknown port:00000000 irq:0 11: uart:unknown port:00000000 irq:0 12: uart:unknown port:00000000 irq:0 13: uart:unknown port:00000000 irq:0 14: uart:unknown port:00000000 irq:0 15: uart:unknown port:00000000 irq:0 16: uart:unknown port:00000000 irq:0 17: uart:unknown port:00000000 irq:0 18: uart:unknown port:00000000 irq:0 19: uart:unknown port:00000000 irq:0 20: uart:unknown port:00000000 irq:0 21: uart:unknown port:00000000 irq:0 22: uart:unknown port:00000000 irq:0 23: uart:unknown port:00000000 irq:0 24: uart:unknown port:00000000 irq:0 25: uart:unknown port:00000000 irq:0 26: uart:unknown port:00000000 irq:0 27: uart:unknown port:00000000 irq:0 28: uart:unknown port:00000000 irq:0 29: uart:unknown port:00000000 irq:0 30: uart:unknown port:00000000 irq:0 31: uart:unknown port:00000000 irq:0