Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UART peripherals on Android Things for Raspberry Pi 3

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

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

like image 479
proppy Avatar asked Dec 13 '16 17:12

proppy


People also ask

Does Raspberry Pi 3 have UART?

In Raspberry Pi 3, mini UART is used for Linux console output whereas PL011 is connected to the On-board Bluetooth module. And in the other versions of Raspberry Pi, PL011 is used for Linux console output. Mini UART uses the frequency which is linked to the core frequency of GPU.

How many UART does Raspberry Pi have?

Technically, the Raspberry Pi has two UARTs: PL011 UART and mini UART. However, you only have one pair of TXD and RXD pins to work with. The PL011 UART is the main UART for models without Bluetooth feature and is tied directly to the Linux console output.


1 Answers

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.

like image 174
proppy Avatar answered Oct 05 '22 23:10

proppy