查看: 9663|回复: 1

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

[复制链接]
  • TA的每日心情
    奋斗
    2014-5-9 09:23
  • 签到天数: 13 天

    连续签到: 1 天

    [LV.3]偶尔看看II

    发表于 2013-2-23 14:21:09 | 显示全部楼层 |阅读模式
    分享到:
    本帖最后由 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


    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2014-8-4 11:18
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

    发表于 2013-2-23 23:19:29 | 显示全部楼层
    不错,学一个,也许能用上
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

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



    手机版|小黑屋|与非网

    GMT+8, 2024-4-27 09:27 , Processed in 0.129264 second(s), 17 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.