适用于Raspberry Pi 3的Android Things上的UART外设 [英] UART peripherals on Android Things for Raspberry Pi 3
问题描述
如何在Raspberry Pi 3的Android Things上使用UART外设?
默认情况下,似乎为它分配了Linux控制台.
默认情况下,UART端口映射到linux控制台,以防止内核消息与您的外设混在一起.
您可以使用以下方法从主机上的sdcard挂载引导分区来禁用控制台:
mount /dev/sdX1 /mnt/disk
其中sdX
替换为您的sdcard读取器设备名称(将sdcard插入阅读器后运行dmesg
应该可以帮助您确定设备名称).
然后编辑/mnt/disk/cmdline.txt
以替换以下内核引导参数:
console=serial0,115200
具有:
console=tty0
如果以后需要重新启用控制台以进行调试,只需添加相同的参数即可.
有关禁用控制台的更多信息,请参见开发人员文档./p>
How do I use UART peripherals on Android Things for Raspberry Pi 3?
It seems that by default it is assigned the linux console.
By default the UART port is mapped to the linux console, in order to prevent the kernel message from messing around with your peripheral.
You can disable the console by mounting the boot partition from the sdcard on your host computer using:
mount /dev/sdX1 /mnt/disk
where sdX
is replaced with your sdcard reader device name (running dmesg
after inserting your sdcard into your reader should help you figure out the device name).
Then edit /mnt/disk/cmdline.txt
to replace the following kernel boot argument:
console=serial0,115200
with:
console=tty0
If you need to re-enable the console later for debugging purpose, just add the same argument back.
See the developer docs for more info on disabling the console.
这篇关于适用于Raspberry Pi 3的Android Things上的UART外设的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!