How to use uart2 in tx2

background: TX2 Jetpack4.2, I need use uart0 uart1 uart2.
question: Uart0 and uart 1 are working normally.How do I use uart2 as normal uart send data?

hello wm18822827507,

please also check Jetson TX2 Series OEM Product Design Guide, and refer to [Table 74. UART Pin Descriptions] and also [Figure 46. UART Connections], that UART2 is using M.2 keys.

I know hardware infomation about uart of OEM Product Design Guide, but i don’t konw how use them in linux. I have 3 tty interfacem which one is for uart2?

opt@opt-desktop:~$ ls /dev/ttyTHS*
/dev/ttyTHS1 /dev/ttyTHS2 /dev/ttyTHS3
opt@opt-desktop:~$ ls -lh /dev/ttyTHS*
crw-rw---- 1 root dialout 238, 1 5月 29 09:31 /dev/ttyTHS1
crw-rw---- 1 root dialout 238, 2 5月 29 09:31 /dev/ttyTHS2
crw-rw---- 1 root dialout 238, 3 5月 29 09:31 /dev/ttyTHS3

hello wm18822827507,

please check kernel messages for mappings.
$ dmesg | grep THS

you might also refer to device tree settings for details.
for example,
$L4T_Sources/r32.4.2/Linux_for_Tegra/source/public/kernel_src/hardware/nvidia/soc/t18x/kernel-dts/tegra186-soc/tegra186-soc-uart.dtsi

Thank you very much, that just what i need, good job, Is the mapping listed below correct?

uarta: serial@3100000 {  // console UART0 ttyS0

};

uartb: serial@3110000 { // UART2? ttyTHS1

};

uartc: serial@c280000 { // UART1 ttyTHS2

};

uartd: serial@3130000 { // UART3? ttyTHS3

};

uarte: serial@3140000 { // UART?

};

uartf: serial@3150000 { // UART?

};

uartg: serial@c290000 { // UART?

};

hello wm18822827507,

you’ll still need to check kernel messages for mappings.
please also refer to serial kernel drivers to register tty device during kernel initialization,
for example,
$ L4T_Sources/r32.4.2/Linux_for_Tegra/source/public/kernel/kernel-4.9/drivers/tty/serial/serial_core.c

int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) 
{
...
 	uart_configure_port(drv, state, uport);
}
1 Like