Hi @linuxdev this was actually quite useful! Unfortunately we still did not make it work, but gave us some additional insights.
Using loopback on the TX and RX pins, it’s possible that the TX2 NX is injecting noise into the UART TX line.
Let me try to explain with the most detail I can provide.
I tested a simple command on both the Jetson Nano and Jetson TX2 NX,
echo "hi" > /dev/ttyTHSx. On the Jetson Nano that is ttyTHS1, on the TX2 NX it’s the ttyTHS2.
Initially we plug a cable from the TX to the RX pins, and sent commands to the /dev/ttyTHS . This was generating an infinite spam on the cat terminal. Looking at the answer from Kristina at Unexpected results testing serial loopback using echo and cat - Unix & Linux Stack Exchange, we found the issue:
Since this serial port is looped back to itself, here is what happened after running
echo "hi" > /dev/ttyS1 :
echo command appends a newline to the end of the message by default, so “hi” + LF is sent out to /dev/ttyS1
- Because “onlcr” was set, the serial device converted the LF to CRLF so the physical message sent out the Tx line was “hi” + CRLF
- Because “icrnl” was set, the physical messaged received on the Rx line converted the CR to LF. So the message outputted by ‘cat’ was “hi” + LFLF.
- Because “echo” was set, the message received on the Rx (“hi” + LFLF), was then sent back out on the Tx line.
- Because of onlcr, “hi” + LFLF became “hi” + CRLFCRLF.
- Because of icrnl, “hi” + CRLFCRLF became “hi” + LFLFLFLF
- Because of echo, “hi” + LFLFLFLF was then sent out the Tx
And so on…
In order to fix this problem, I ran the following command:
stty -F /dev/ttyS1 -echo -onlcr
Disabling “echo” prevents an infinite loop of messages and disabling “onlcr” prevents the serial device from converting LF to CRLF on output. Now
cat receives one “hi” (with a single newline!) for each time I run
Afterwards, we were able to send single messages thought the UART. On the pictures bellow you may find prints of the tests on the executed :
Jetson Nano (works fine…):
Jetson TX2 NX (it does not generate infinite spam, but it prints a crazy amount of ‘command not found’):
@mike_nv , looking at kern.log, as far as we know, there don’t seem to be any issues.
kern.txt (92.9 KB)
During the 1st test we realised that if the hardware loopback was connected while the Jetsons were turned off, the Jetson Nano would boot normally, but TX2 NX would not boot. We would always need to unplug the connection, boot the TX2 NX, and plug it back again for the test.
Using a logic analyser to probe the lines, the difference is clearly visible.
Jetson TX2 NX:
With the Jetson Nano we can see the expected behaviour, the Jetson writes the “hi” text on the UART line and goes silent, on the TX2 NX it writes “hi” has a small wait and then introduces more data on the line which it was not commanded to do.