UART peripherals on Android Things for Raspberry Pi 3

偶尔善良 提交于 2019-11-26 17:04:12

问题


How do I use UART peripherals on Android Things for Raspberry Pi 3?

It seems that by default it is assigned the linux console.


回答1:


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.




回答2:


Beginning with Developer Preview 3, in which USB-Serial devices support added, external USB-UART dongles like this can be used instead of built-in UART of Raspberry Pi 3.



来源:https://stackoverflow.com/questions/41127018/uart-peripherals-on-android-things-for-raspberry-pi-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!