How to connect to console in HiKey970 in Android

Hi all,

I’ve successfully installed official AOSP from 96Boards (I got the images from: Android Open Source Project (AOSP) Downloads for HiKey970 - 96Boards).

I can see the debug output when I connected to UART6 port via DEBUG_UART6_TXD and DEBUG_UART6_RXD but I can’t send any commands via it.

Could you help me how I can connect to a terminal console of my Android?

Thank you in advance

Which kind of adapter are you using to connect your host computer to the UART?

Im using this one, 1.8V:

+1 on the issue: @Mani did you have any luck with this?
@mikluz what is your board revision?

@ric96 @mikluz No :frowning: I’m also facing the same issue. Will debug more and let you know.

@mikluz @ric96

So the console input only works with on-board Type C debug UART port (on the left side near LS expansion header). Not on LS-UART1. I’d say that this could be a hardware issue.

The on-board debug UART port will be enumerated as ttyXRUSB.

Hope this helps!

Thanks,
Mani

Yes,
that is correct. UART6 doesn’t provide TX channel, you can only read out messages using RX pin.

So, to be able to see the console output you need to connect to USB-C port. This allows you to read and send commands.

Hi @mikluz. I’ve been trying to debug my hikey970 board using the USB-C port, but TX doesn’t seem to be working. Is there a particular setup you needed to do in order to get this working?

Cheers!

been looking for info on this too.
seems it is not connected or something like that.

The USB-C on the side is a serial console.
Unfortunately some people report it to be fully functional and some report it to only show info but not accept any input.
There is some talk about the bootloader binaries but no conclusive results or reproducible.

It would be nice to find out what makes the USB-C console available for input. I have been scratching my head over this for quite some time now.

@janrinze As I said in other post, Hikey970 uses XR21B14 chip for the USB-C debug serial port. The driver for this chip is not available in upstream linux kernel but since it supports part of USB CDC class, it does appear as ttyACM0 port. But this chip uses custom flow control modes which can’t be supported by usb cdc driver and flow control is needed for input. That’s why you can’t type anything onto the default ttyACM0 console but you can see the output.

Coming to your question on some people got it working fully, that is mainly due to the packaging of specific driver for this chip in the distro version. For instance, Ubuntu 18.04 has this driver enabled, so users who have this specific distro will be able to use it without any issues. They will have the console as ttyXRUSB0 instead of ttyACM0.

So if you need to use this port, please build the driver(just google xr21b14 driver, you’ll find it) and load onto your PC.

Hope this helps!

@janrinze On other note, I’ve started looking into upstreaming this driver. The plan is to make the driver reuse USB core support in linux so that the port will be exposed as ttyUSBn instead of special ttyXRUSBn.

Thanks for the explanation.
It’s all clear to me now!