UART0 use on Hikey LeMaker

So is anybody using UART0 on the Hikey Lemaker version ? If yes, what uart to usb cable are you using ? I cant seem to find one online easily.

I also read some posts on the forum which said all UART output is now on UART3 and using the mezzanine board is the easiest way to have UART interaction to the Hikey board. If this is the case, is there no use for UART0 on the Hikey board ?

I would also like to know what or who uses UART2 since UART3 is used by Arm Trusted Firmware, UEFI and Linux. I plan to run OP-TEE on the board so I would like to use some UART for OP-TEE’s output.

You can use UART0 in place of UART3 if you want, but it requires some level of effort. You will need to obtain a 1.8V FTDI cable, part number: TTL-232RG-VREG1V8-WE. This comes with a Type A USB connector on end and 6 wires on the other. You also need to solder a 4-pin header on J601, and connect the cable to the header as such:

J16 (or J801*) pin 1 (1.8V) <-> Red Wire (VCC) - not needed, do NOT connect
J16 (or J801*) pin 2 (RxD) <-> orange wire (TXD)
J16 (or J801*) pin 3 (GND) <-> black wire (GND)
J16 (or J801*) pin 4 (TxD) <-> yellow wire (RXD)

Additionally, you also need to rebuild from source: https://github.com/96boards/documentation/wiki/HiKeyUEFI#how-to-use-uart0-as-console

Afaik, nothing uses UART2 for now and is not supported. OP-TEE also uses UART3 by default. If you want to have a separate UART (i.e. UART0) for OP-TEE, you have to rebuild OP-TEE based on the link above, and then rebuild ARM-TF (without any changes to it) to get fip.bin which you then need to flash onto the board.

*Lemaker version

I thought you could use this board, it is much cheaper:
http://www.waveshare.com/ft232-usb-uart-board-type-a.htm
You can buy on aliexpress.
J16 pin 1 (1.8V) <-> VCCIO
J16 pin 2 (RxD) <-> TXD
J16 pin 3 (GND) <-> GND
J16 pin 4 (TxD) <-> RXD

Just do not forget to remove the jumper.

This is 3.3 or 5v only. You need 1.8v.

Have you actually tried it? Does it work for you maybe?

Sorry, correction to the label above.
J16 is for the Circuitco version.
J801 for Lemaker.

No, this device have 3 power mode : 5V output, 3.3V output, or powered by target board.
From datasheet FT232R:
VCCIO - +1.8V to +5.25V supply to the UART Interface and CBUS group pins (1…3, 5, 6, 9…14, 22, 23). In USB bus powered designs connect this pin to 3V3OUT pin to drive out at +3.3V levels, or connect to VCC to drive out at 5V CMOS level. This pin can also be supplied with an external +1.8V to +2.8V supply in order to drive outputs at lower levels.

At the moment, I can not test it. As soon as I get the package I will write about the results.

Ok. It would be good if it can be used as a less expensive alternative, so please let us know if it works.

Note that you’d still have to solder the 4-pin header to J16/J801 and rebuild from source.

Thanks @vchong and @R6MF49T2. Have a couple more questions.

vchong,

Did you mean J801 ? I have the lemaker version. There is no J16 on the LeMaker version from what i can tell.

when you say UART2 is not supported, do you mean i cant use it even if i made the effort to connect it and modify the code to use UART2 ? Cant i make similar changes like im supposed to do for UART0 except with UART2 addresses and use UART2 ?

Next question, if the entire software stack uses the same UART, wont there be contention for the UART if code in multiple cores wants to write out to the UART?

Do you know if we need drivers on the host system(windows/linux) to use the 1.8V FTDI cable, part number: TTL-232RG-VREG1V8-WE cable ?

can i use the TE-C0344 cable(advertised for Dragonboard410c) for UART0 ?

Hi,

When you using TTL-232RG-VREG1V8-WE,
it is safer not to connect VCC as bellow, only with three wires.

J16 (or J801*) pin 2 (RxD) <-> orange wire (TXD)
J16 (or J801*) pin 3 (GND) <-> black wire (GND)
J16 (or J801*) pin 4 (TxD) <-> yellow wire (RXD)

If connecting VCC then FTDI230 chip will be powered from two 1.8V sources, one from header pin on HiKey and another from USB connector, which works on short term but it is known to damage the power source in long term.

The UART0 on the Hikey.

J16 is printed on CircuitCo

J801 is printed on LeMaker

The both J16 and the J801 are the same UART0.

Honestly
using UART3 is much easier.

You do not have to rebuild the bootloader and the kernel to see the serial console.

We recommend to use one of these.
https://www.96boards.org/products/mezzanine/uarts
or
http://www.seeedstudio.com/depot/96Boards-Sensors-p-2617.html
http://www.seeedstudio.com/depot/Grove-Starter-Kit-for-96Boards-p-2618.html

Please do not use UART2 for serial console.

The UART2 is already used for communicating Atmega320p and STM32 on the Mezzanine boards.

All of these mentioned above uses the FTDI230X chip which does not require any additional driver on the host PC.
The both Linux and Windows have the driver included for FTDI230X chip.

@raghu.ncstate Sorry for the late reply.

> Did you mean J801 ? I have the lemaker version. There is no J16 on the LeMaker version from what i can tell.
Answered by Akira.

>when you say UART2 is not supported, do you mean i cant use it even if i made the effort to connect it and modify the code to use UART2 ? Cant i make similar changes like im supposed to do for UART0 except with UART2 addresses and use UART2 ?
I’m not sure if UART2 is used for something else. Akira mentioned above it’s used for something. I suppose you can make it work if you want, but it might require a lot of effort and probably not worth it. You can’t just make similar changes like you’re supposed to do for UART0, because some of them just use a flag instead of the actual register address to denote the use of UART0 or UART3, so you’ll actually have to go and change the code itself in several (many?) places. So, make your life easy, and just use UART0 and UART3.

> Next question, if the entire software stack uses the same UART, wont there be contention for the UART if code in multiple cores wants to write out to the UART?
Basically yes. Or contention from both normal and secure world.

> Do you know if we need drivers on the host system(windows/linux) to use the 1.8V FTDI cable, part number: TTL-232RG-VREG1V8-WE cable ?
Yes I think so. You can get them here: http://www.ftdichip.com/Drivers/VCP.htm

> can i use the TE-C0344 cable(advertised for Dragonboard410c) for UART0 ?
I’ve not used this myself but I believe you can since all 96boards follow the same spec.

I checked the board http://www.waveshare.com/ft232-usb-uart-board-type-a.htm.
Solder the resistor divider to get 1.8V.
The result was cheap and workable solution.

Hi R6MF49T2

Really like the wire mod. However I’m also very lazy… did you try out your original idea of using the 1v8 voltage reference provided by the Hikey instead of generating the reference on the UART board?

Daniel.