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/