Mt7688在WRTnode2R上引出了2个串口
即图中下部的UART1,平时我们一直使用的是UART0,今天来连接UART1使用
- uartlite1@d00 {
- compatible = "ns16550a";
- reg = <0xd00 0x100>;
- reg-shift = <2>;
- reg-io-width = <4>;
- no-loopback-test;
- resets = <&rstctrl 12>;
- reset-names = "uartl";
- clock-frequency = <40000000>;
- interrupt-parent = <&intc>;
- interrupts = <21>;
- pinctrl-names = "default";
- pinctrl-0 = <&uart1_pins>;
- };
在WRTnode2R.dts中可以看到已经启用了第2个串口
串口1即/dev/ttyS1,将USBTTL连接到这个串口。但是运行
- echo hello,world! > /dev/ttyS1
并没有正确输出。
在WRTnode2R上安装stty
- root@OpenWrt:~# opkg install coreutils-stty
- Installing coreutils-stty (8.23-1) to root...
- Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/packages/coreutils-stty_8.23-1_ramips_24kec.ipk.
- Installing coreutils (8.23-1) to root...
- Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/packages/coreutils_8.23-1_ramips_24kec.ipk.
- Configuring coreutils.
- Configuring coreutils-stty.
显示该串口与串口0不同,波特率为9600
通过指令
- stty -F /dev/ttyS1 raw 115200
讲该串口波特率设置为115200
再次运行
- echo hello,world! > /dev/ttyS1
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。