Jetson TX2 UART2 Not Writing Properly

We’re working with the J120 carrier board from Auvidea to use the UART2 port on the Jetson. We are using their patched device tree file (Jan 2018 file from https://auvidea.com/firmware/), and in the past have been able to successfully perform a loopback test on UART2, which enumerates as /dev/ttyTHS1. At some point we modified the device tree to make other changes, realized our changes broke things and reset the device tree to the provided Auvidea default. However, the loopback test no longer works. We are able to read from /dev/ttyTHS1 just fine (using a 3.3V GPS that we have been working with). However, when we perform the loopback test and type in test messages, garbage shows up. We’ve tested with 9600, 38400 and 115200 baud. Probing with a logic analyzer shows the same garbage on the TX pin. We haven’t connected to any UART device that would be operating at 5V, so I can’t imagine that we’ve fried the port. We’ve confirmed that there aren’t other processes using the port. Also, note that we’re still using JetPack 3.1, L4T R28.

I know there are lots of related posts; I’ve read through as many as I could find, and we’re still having the same issue. Any help would be appreciated!

Perhaps the number of stop bits changed. Try both one and two stop bits.

Unfortunately, we see the same behavior with both one and two stop bits.

It would be hard to imagine loopback sets different setup for TX and RX, so I would lean towards the software using the port as the issue instead of the port itself. Still, garbage is usually from incompatible bit rates or other offset of bits. If the application sending used a different character set than the application receiving, then I might expect oddness in display, but I wouldn’t expect a protocol analyzer to also show the issue (clearly data itself is off and not just the display of data).

What is your method or software for sending data? What is your method or software for receiving data? Do you flush/sync between reads and writes? If you alternate reading/writing of no more than perhaps 8 bytes at a time, does it differ versus if you read/write something larger (e.g., 128 bytes at a time)? I’m thinking about buffer size versus amount of data.

If you send all NULL bytes, or all 0xff bytes, do you see any pattern in the garbage? Example, perhaps a bit flips walking from first bit to last bit.

I am seeing the same problem. rachel0, were you able to find a solution?

I tried all the suggestions from linuxdev, but the only way I found to fix the problem was recompiling the kernel (again). I never followed up on the thread because I figured that solution was not the most helpful. Best of luck with your issue though!