Jetson Nano how to use UART

Hello , I have problem with transfering data via UART from my jetson nano board.
I connected pin 8 (TX) and pin 10 (RX) with a TTL module which can connect to my pc through a USB port. I tried to send data that is just a number “1” from jetson nano through UART , output of th pc’s monitor should be 111111111 but monitor showed a list of strange characters. Any body have same prob with me ?

That UART is running serial console. Disable it first:

  1. sudo systemctl stop nvgetty.service
  2. sudo systemctl disable nvgetty.service

Hint: Any file permission for a serial UART with group owned by tty it is a console. If the group of the device special file is instead dialout, then you are free to use the UART. You can add your user to supplemental group dialout so that user does not need to use sudo. For example, if your user name is “user”, then this adds group dialout to user:
sudo usermod -aG dialout user

I diasbled nvgetty but the problem is still unresolved . My jetson nano can read data which transfer from other MCU through UART , but in reverse it can’t.

The next step would be to test in loopback. If you connect TX to RX (and optionally CTS to RTS if flow control is enabled), and simply attach a serial console terminal to the UART, does typing in text work to echo back? Or does nonsense echo?

I followed the instruction in Jetson Nano - UART - JetsonHacks .When i sent a random number form PC’s terminal, my jetson nano can read exactly but in reverse data transfered from jetson to my terminal were scrambled. It means that RX pin work correctly and TX pin has problem ? I’m a new member in embedded system so I don’t have much knowledge in this .

Was the loopback mode doing this? Or was it between the Jetson and another UART? Testing requires loopback mode

Yes , I tested in a loopback .
I tried running a program which has 2 mode : transfer and receive , but my jetson nano can read data receive only.

In loopback mode there is no possibility of voltage levels being mismatched, so either there is a hardware issue (not necessarily something broken, but perhaps something simpler, e.g., needing a pull-up resistor), or some software issue.

You mentioned a program with transmit and receive. Was this also tested with a serial console program? I am thinking you will say “yes”, but need to verify. A single serial console program going to a loopback UART will never disagree with itself about software settings. It could be you need to also loopback jumper CTS to RTS and enable CTS/RTS flow control, but I doubt that would be an issue (it is worth doing though just to be thorough).

As a last test, do you have any kind of oscilloscope or logic analyzer you can put on this just to see if there is traffic during send while using a serial console program in loopback mode?

I’m thinking that my program has some wrong command , so do you have any example program for testing in loopback mode ? I found in github but they all didn’t work for me and I am understanding that loopback mode is using jetson nano to transfer and receive data by itself ? Right ?
Unfortunately, I don’t have osilloscope for verify voltage level on each TX and RX pin.

Correct, the Jetson talks to itself when in loopback (thus loopback is a good test since the UART will normally agree with itself regarding matching settings, whereas two separate UARTs require care to make both sides use the same settings).

Most people use the old “minicom” program, but it has some features which complicate it to support older dialup connections, and so I prefer “gtkterm” ("sudo apt-get install gtkterm"). If the UART is “/dev/ttyTHS2”, then this is an example (only use sudo if your user is not a member of the group of the UART and it denies permission):
gtkterm -b 8 -t 1 -s 115200 -p /dev/tty

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.