TX2 serialport,UART1 on J21(40 pin Exp Header)

I want to use the UART1 on J21(pin8:TXD pin10:RXD pin9:GND),but when i connected pin8 and pin10 together,and use CUTECOM to test,there is no responce. I use the same way to test UART2(ttyTHS2),it was success.

Did anyone uesd UART1 before? Does ttyTHS1 represents UART1?

hello zhujx_linux,

suggest you should check Topic 1056970 for serial communication using UART1 on J21.
thanks

hi JerryChang,
thank you so much for answer my topic, i’ve lerned a lot in Topic 1056970,
i have already used the uart on J17, i am just don’t know whether the uart on j21 is ttyTHS1 or not?
and its physical location on J21?(i have upload the photo of J21,the pin which the triangle point is pin 1?)
Or should i make some setup works before i use the uart on J21?

please also refer to JETSON TX2 HEADER PINOUT for the pin layouts.

[quote=“JerryChang”]

then in the test i used the pin8 and pin10 correctly, but i connect pin8 and pin10 together and i use cutecom to send message through /dev/ttyTHS1, but nothing happend, i cannot see what i send.

Within the Jetson itself there are two possible drivers for each serial device. One is the ordinary serial UART driver, another is the NVIDIA “high speed” UART driver (HSUART, which uses DMA). The Tegra serial UARTs work with either driver, but not both at the same time (it would be undefined what would happen if two drivers try to simultaneously use the same hardware).

When the regular driver is used the “/dev/” name will be the standard “/dev/ttyS#”, e.g., “/dev/ttyS0”. When the NVIDIA HS UART driver is used, the “/dev/” name will be “/dev/ttyTHS#”. The “#” will be the same for a given UART regardless of which driver is used, e.g., if “/dev/ttyS2” uses a particular UART, then the same hardware (but different driver) is also referred to as “/dev/ttyTHS2”.

The J21 UART is a special case because it is already assigned as serial console. At best you will have an interesting time with your i/o doing unexpected things while talking to a shell. If you run this command, then you will see most of the ttyS are group “dialout”, but one is “tty”:

ls -l /dev/ttyS*

The serial console going to J21 is “/dev/ttyS0”, and is group “tty”, whereas the others are group “dialout”. The “dialout” UARTs are the only candidates for safe use unless you’ve disabled the serial console.

Now examine this:

ls -l /dev/ttyTHS*

You’ll notice that most of the tty have both a “ttyS” and a “ttyTHS”, but serial console (“ttyS0”) does not. Most people will choose the “ttyTHS” HS UART driver, in which case the “ttyS” driver should not be used, but the HS UART drivers are not available prior to Linux loading. In order to allow serial console to function in earlier bootloader stages (which do not have the HS UART driver), and to have continuous continuity of service during boot (changing drivers would imply a moment of the UART not being available), the non-HS driver must be used the entire time.

For the existing ttyS/ttyTHS combinations, the J17 connector is “ttyS2”/“ttyTHS2” and is free to use. Note this is group “dialout”. If you were to disable the serial console, then the group would revert from “tty” to “dialout”.

The reference to ttyS1/ttyTHS1 is unrelated to the J21 pin 8/10 UART and is another UART (I don’t know which pins).

FYI, serial console uses settings are 115200 8N1. See:
http://www.jetsonhacks.com/2017/03/24/serial-console-nvidia-jetson-tx2/