1回答

0收藏

[教程] [zz]使用树莓派上的串口

Raspberry Pi Raspberry Pi 10908 人阅读 | 1 人回复 | 2013-02-23

本帖最后由 AlchMeow 于 2013-2-23 14:23 编辑

Using the serial port on the RaspberryPi
使用树莓派上的串口

http://elinux.org/Using_the_serial_port_on_the_RaspberryPi

there are several minor things in the way if you want to have dedicated control of the serial port on a raspberry pi
如果你想使用树莓派P1上的串口的话,你得像下述的那样干:

the first is kernel boot messages at startup, those are caused by the kernel parameter console=ttyAMA0,115200 set in /boot/cmdline.txt
kernel debuging is also on the serial port and i dont know what effect it may have on the end-use, so you may want to turn that off also in cmdline.txt, just remove kgdboc=ttyAMA0,115200
首先在/boot/cmdline.txt 移除内核启动信息输出和内核调试信息输出
  1. $sudo nano /boot/cmdline.txt
复制代码
去掉console=ttyAMA0,115200  和 kgdboc=ttyAMA0,115200  ,然后存盘。

next is the login prompt, set in /etc/inittab with the line T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
然后禁止掉从串口登录的功能,
  1. $sudo nano /etc/inittab
复制代码
去掉 T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 ,存盘。

once all of those are off, you can use /dev/ttyAMA0 like any normal linux serial port, and you wont get any unwanted traffic confusing the attached devices
现在你可以像使用一个普通串口那样使用/dev/ttyAMA0


分享到:
回复

使用道具 举报

回答|共 1 个

倒序浏览

沙发

jszsj

发表于 2013-2-23 23:19:29 | 只看该作者

不错,学一个,也许能用上
您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条