打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
【WRTnode2R试用体验】MT7688串口1的使用
 Mt7688在WRTnode2R上引出了2个串口


即图中下部的UART1,平时我们一直使用的是UART0,今天来连接UART1使用
  1. uartlite1@d00 {
  2.                         compatible = "ns16550a";
  3.                         reg = <0xd00 0x100>;

  4.                         reg-shift = <2>;
  5.                         reg-io-width = <4>;
  6.                         no-loopback-test;

  7.                         resets = <&rstctrl 12>;
  8.                         reset-names = "uartl";

  9.                         clock-frequency = <40000000>;

  10.                         interrupt-parent = <&intc>;
  11.                         interrupts = <21>;

  12.                         pinctrl-names = "default";
  13.                         pinctrl-0 = <&uart1_pins>;

  14.                 };
在WRTnode2R.dts中可以看到已经启用了第2个串口

串口1即/dev/ttyS1,将USBTTL连接到这个串口。但是运行
  1. echo hello,world! > /dev/ttyS1
并没有正确输出。
在WRTnode2R上安装stty
  1. root@OpenWrt:~# opkg install coreutils-stty
  2. Installing coreutils-stty (8.23-1) to root...
  3. Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/packages/coreutils-stty_8.23-1_ramips_24kec.ipk.
  4. Installing coreutils (8.23-1) to root...
  5. Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7628/packages/packages/coreutils_8.23-1_ramips_24kec.ipk.
  6. Configuring coreutils.
  7. Configuring coreutils-stty.



显示该串口与串口0不同,波特率为9600
通过指令
  1. stty -F /dev/ttyS1 raw 115200

讲该串口波特率设置为115200


再次运行
  1. echo hello,world! > /dev/ttyS1


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
stty设置串口命令
linux系统下查看uart和usb设备
TTY的那些事儿
Hi3516EV200使用UART1笔记
linux移植记录(一)-串口驱动
A40i T3开发板外扩接口的功能测试
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服