本帖最后由 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 移除内核启动信息输出和内核调试信息输出- $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 然后禁止掉从串口登录的功能, 去掉 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了
|