Serial (UART) access from Android AOSP on HiKey 960


#1

I saw that the HiKey 960 has hardware support for several serial UART ports but I did not find how to access them from an Android app directly. Does AOSP support this?


#2

I don’t think so. There is a Java UART API for Android Things but that
shouldn’t be present on a phone build.

A common approach would be to write an NDK library to talk to the UART
and then make some system level changes to “break” the security settings
to allow the app to talk to the device node. This can be as simple as
chmod 666 /dev/ttyXXXY (and maybe tweaking or disabling SELinux)
although more sophisticated approaches are possible.


#3

A post was merged into an existing topic: State of gpio on 960?