ILD

Raspberry Pi 3 Model B使用串口
作者:Herbert Yuan 邮箱:yuanjp@hust.edu.cn
发布时间:2019-9-27 站点:Inside Linux Development

本文使用的固件:2018-03-13-raspbian-stretch-lite.img


树莓派3有两个uart,主uart用作蓝牙,miniuart默认没有打开。首先修改/boot/config.txt,添加:

1
enable_uart=1


重启后,可以看到:

1
2
pi@raspberrypi:~$ ls /dev/serial*
/dev/serial0  /dev/serial1

多出一个/dev/serial0,这个就是miniuart。


将usb转串口线接到插座,接法可参考资料【3】如下:


黑线是地,接6;白线是TX,接8;绿线是RX,接10。红线是供电,如果已经使用USB供电的话,就不需要接,接了可能烧板子。


启动minicom,重启树莓派,过几秒,串口就有内核的输出啦。


参考资料

【1】https://www.raspberrypi.org/documentation/usage/gpio-plus-and-raspi2/README.md

【2】https://www.raspberrypi.org/documentation/configuration/uart.md

【3】https://jingyan.baidu.com/article/14bd256e7afb78bb6c261246.html


Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.