用于 Raspberry Pi 3 的 Android Things 上的 UART 外设 [英] UART peripherals on Android Things for Raspberry Pi 3
问题描述
如何在适用于 Raspberry Pi 3 的 Android Things 上使用 UART 外设?
似乎默认分配了 linux 控制台.
默认情况下,UART 端口映射到 linux 控制台,以防止内核消息干扰您的外设.
您可以使用以下命令从主机上的 SD 卡安装引导分区来禁用控制台:
mount/dev/sdX1/mnt/disk
其中 sdX
替换为您的 sdcard 读卡器设备名称(在将您的 sdcard 插入读卡器后运行 dmesg
应该可以帮助您找出设备名称).
然后编辑/mnt/disk/cmdline.txt
以替换以下内核启动参数:
console=serial0,115200
与:
console=tty0
如果您稍后需要重新启用控制台以进行调试,只需添加相同的参数即可.
有关禁用控制台的更多信息,请参阅开发人员文档.>
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屋!