How to use UART in GPIO pins?

How to use UART in the 40 GPIO pins? Or where are the pins for ttyTCU0 ttyTHS0/1/4?

There is a nice header pinout diagram here:

These would be 3.3V TTL level. I haven’t looked yet to see which UART pins go to which device.

If you are referring to serial console, then this does not go to the 40-pin header. It goes to the micro-USB connector on the left as you face the 40-pin header. For that you simply need a micro-B USB cable to your host, and the host needs the FTDI serial UART driver (most Linux distributions have this by default).

Thanks. I tried to connect to another device using that UART GPIO pins. But the port didn’t send or receive anything. I saw the serial port description “Don’t use as GPIO” from your link.Do I need to manually enable it?

The GPIO UART is ttyTHS0. And it worked at 115200.

FYI, many pins are GPIO, and the specific function depends on device tree. Some other pins may be dedicated as a UART (special function I/O, SFIO) and not designed to be GPIO. Even cases where a pin is dedicated to a non-GPIO function there may be device tree settings related to the controller of that pin, e.g., power rails. Since it worked for you as ttyTHS0 it seems device tree is good to go.


I’m using release 32.1 on the Xavier and would like to see if it’s possible the bootlogs on uart, if possible to have uart console to interract with the board.

My cmdline says I have 2 consoles out of which one is the framebuffer console which works ok, and the other is ttyTCU0:

console=ttyTCU0,115200n8 console=tty0 fbcon=map:0

I’ve tried connecting to gpio pins like specified here but I can’t see anything on the serial console.

The USB debug cable does not create any ttyUSB devices either.

I’m seeing these logs:
[ 0.000000] earlycon: tegra_comb_uart0 at MMIO32 0x000000000c168000 (options ‘’)
[ 0.000000] bootconsole [tegra_comb_uart0] enabled
[ 0.015876] bootconsole [tegra_comb_uart0] disabled

Does this mean that it’s disabled from the dtb and that’s why I don’t see anything on the GPIO 8 and 10 pins?

On the Jetson Nano all works well, but on the Xavier I’m not figuring out what I should do to have a uart console since bootloaders are loaded.

Thank you

I haven’t installed R32.1 on an Xavier yet, but for the TX2 the serial console has not changed when going to R32.1. I expect the Xavier will also be the same with regards to serial console functioning without any additional effort. I did notice that R32.1 serial console fails to show shutdown messages (which is a problem if you are debugging), but otherwise it works correctly.

The Xavier differs from other Jetsons in terms of pinout. While others have you connect to header pins, the micro-USB connector (when used with a micro-B cable) exposes an FTDI serial UART. One merely connects a micro-B USB cable between a host’s type-A connector and the Xavier’s micro-USB…and if there is an FTDI driver, then it will “just work” (on your host you’d have to point your serial console program at the correct “/dev/ttyUSB#”). No separate USB serial UART is required…it is built in to the Xavier.

Thanks linuxdev! The issue appears to have been from some bad cables. ttyTHS0 inside the dtb for cmdline and a better uart adapter connected to the gpios did the trick.