我正在研究一个使用beaglebone black的项目,该项目通过USB(在MAC上)连接到Mini-USB(在beaglebone上)。
因此,对于我来说,在beaglebone端的串行端口上读取或写入任何数据-我需要知道端口号。有什么办法可以找到分配给MINI-USB的TTY端口?我知道它是/dev/tty
中的一员。
谢谢!
debian@beaglebone:~$ ls -l /dev/ | grep tty
crw-rw-rw- 1 root tty 5, 2 Jun 17 16:08 ptmx
crw-rw-rw- 1 root tty 5, 0 Jun 17 13:18 tty
crw--w---- 1 root tty 4, 0 Jun 17 13:18 tty0
crw--w---- 1 root tty 4, 1 Jun 17 13:18 tty1
crw--w---- 1 root tty 4, 10 Jun 17 13:18 tty10
crw--w---- 1 root tty 4, 11 Jun 17 13:18 tty11
crw--w---- 1 root tty 4, 12 Jun 17 13:18 tty12
crw--w---- 1 root tty 4, 13 Jun 17 13:18 tty13
crw--w---- 1 root tty 4, 14 Jun 17 13:18 tty14
crw--w---- 1 root tty 4, 15 Jun 17 13:18 tty15
crw--w---- 1 root tty 4, 16 Jun 17 13:18 tty16
crw--w---- 1 root tty 4, 17 Jun 17 13:18 tty17
crw--w---- 1 root tty 4, 18 Jun 17 13:18 tty18
crw--w---- 1 root tty 4, 19 Jun 17 13:18 tty19
答案 0 :(得分:0)
dmesg | grep序列
将返回类似:
44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 159, base_baud = 3000000) is a 8250
48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 160, base_baud = 3000000) is a 8250
猫/ proc / tty / driver / serial
还将提供有用的信息:
serinfo:1.0 driver revision:
0: uart:8250 mmio:0x44E09000 irq:158 tx:4380 rx:0 RTS|CTS|DTR|DSR
1: uart:8250 mmio:0x48022000 irq:159 tx:0 rx:0 CTS|DSR|CD|RI
2: uart:8250 mmio:0x48024000 irq:160 tx:0 rx:0 CTS|DSR
3: uart:unknown port:00000000 irq:0
4: uart:unknown port:00000000 irq:0
5: uart:unknown port:00000000 irq:0
在这两种情况下,您都将找到所有活动的串行端口,并且需要弄清楚要使用哪个端口。