TX2 serialport,USART1

Recently I am trying to use the serial port of TX2,but there is a problem.
i connected the TX and RX of USART1,and i opened two termianls,
one cat dev/ttyS0 the other echo “123”>/dev/ttyS0/
but in the first terminal there was nothing ,i can’t see “123” or something else

i want to know how to use the serialport USART1?

Which physical connector is this on? Is this the development kit carrier board?

On the dev kit “/dev/ttyS0” is serial console ("/dev/ttyS0/" is probably a typographic error), and uses default of 115200 8N1, but since it is already in use as a serial console echo would not do what you expect for that particular port (connector J21).

J17 is free for use and is “/dev/ttyTHS2”. If on the TX2 you were to wire the J17 TX and RX pins together (and optionally CTS/RTS pins), then it would be in loopback mode and you would be able to send or receive to/from itself. The reason this is useful is that normally you have to worry about whether both ends use the same settings (mixed settings can cause failure). In loopback you know both ends have the same settings. Then you can test with a serial console program, for example gtkterm, and see echo if the values you have chosen work.

An example of talking to the J17 connector in loopback with gtkterm (use with sudo if you have permission issues):

gtkterm -b 8 -t 1 -s 115200 -p /dev/ttyTHS2

…which would see self-echo if you type on the keyboard and settings are valid.