Use UART Pins on Jetson Xavier NX J14

I’m trying to connect my Pixhawk to the Xavier NX using the UART Ports on J14. I have verified that the connection works using an UART to USB adapter, but to keep all USB ports open for other hardware, I want to connect it directly to the UART Port.
I also have a Jetson TX2 where I can “cat” on “/dev/ttyTHS1” and see the output. On the Xavier it doesn’t show anything.
Does anyone have a clue what could be the problem?
Thanks in advance.

I can’t tell you any specifics based on pins of the NX, but some of the pins and labels differ on different Jetsons. The default connection setup on the NX will be speed 115200, 8N1. If you run command “ls -l /dev/ttyTHS*”, then if you see group “dialout” I would expect that the UART should be ok to use if you have the pins to connect to it. In the case of group “tty”, then you are in conflict with serial console.

Keep in mind that any ttyS# and ttyTHS# with a matching “#” number is the same hardware, but serviced by different drivers. Also be sure you access that hardware only via one driver. Mostly this is not an issue except for the serial console port.

So /dev/ttyTHS1 is in the “dialout” group, I also already disabled the nvgetty service so I don’t have any issues with other serial consoles.
So the baudrate of my connection is 80000 Bytes per seconds. Do I maybe have to set it on the Jetson?

And regarding ttyS# and ttyTHS# does that mean it doesn’t matter which I use, as long as I only use one and don’t have any conflict?


FYI, the default baudrate settings is 115200/8n1.
you may also check L4T sources for reference,
for example,

80  /* Default UART setting when started: 115200 no parity, stop, 8 data bits */
81  #define TEGRA_UART_DEFAULT_BAUD			115200

Yes, you need to set the UARTs at both halves of the pipe to use the same specs.

FYI, if you have ttyTHS1 as dialout, you are probably ok. You’d also want to be certain that (if it exists) “/dev/ttyS1” is also dialout (same hardware, different drivers). Also, keep in mind that this is within Linux, but if you have issues during boot, then it is possible the bootloader still uses this as a serial console (just something to keep in mind).

FYI, the ttyS# uses the older traditional driver, while the ttyTHS# uses the “Tegra High Speed” driver, and takes advantage of DMA. If the UART were required during boot (prior to Linux loading, such as in the bootloader for serial console), then it would use the ttyS#. This is because the boot code has supported the traditional driver for a very long time, and porting the THS driver to bootloader code would not be worthwhile. If one is trying to get a serial boot log from boot the full run in Linux, then there would be a loss of serial console service when switching between two drivers…thus serial console traditionally sticks to the ttyS# driver at all times.
Did you fix your issue?
I’m currently using Pixhawk with Xavier NX as well. Pixhawk is configured to receive a connection on Telem2 port, baudrate 500000 8N1. On the Xavier NX side, I have it connected to /dev/ttyTHS0, UART1 on the 40-pin header.
I’m also using MAVROS, which I’m able to make a connection and receive data from the Pixhawk. My issue is on sending commands from Xavier to Pixhawk. All commands I’m getting CMD: wait ack timeout .
So in short, I have the communication from Pixhawk → Xavier working, but I don’t have Xavier → Pixhawk.
A colleague was able to get the same setup working on a Jetson Nano, but moving to Xavier NX he had the same issue.
Let me know if you faced something similar.

1 Like

I am having the same issue. Connecting pixhawk telem2 to Xavier Nx on J14 UART (with 115200/8n1). This works well on Jetson Nano when using J41 UART. Whats different for Xavier NX?