This section tests the serial port's self-transmitting and receiving functions of Jetson Nano. The serial port device number of Jetson Orin NX and Jetson Orin Nano motherboards needs to be modified to /dev/ttyTHS0.
From the figure below, you can see that the TXD and RXD pins of the serial port of JETSON NANO correspond to physical pins 8 and 10 respectively.
Wiring: JETSON NANO pin 8 (TXD) → JETSON NANO pin 10 (RXD)
Download a serial port communication case from github. The source code and explanation can be viewed at this github link
xxxxxxxxxx
git clone https://github.com/JetsonHacksNano/UARTDemo
Enter the folder
xxxxxxxxxx
cd UARTDemo
If you do not plan to use the serial console on the UART, you should disable the serial console (it depends on your choice):
xxxxxxxxxx
systemctl stop nvgetty
systemctl disable nvgetty
udevadm trigger
Install serial module
xxxxxxxxxx
sudo apt-get install python3-serial
Enter the terminal to run the program:
xxxxxxxxxx
sudo python3 uart_example.py
After running, you can see that Jetson Nano sends the characters in "NVIDIA Jetson Nano Developer Kit\r\n" in a loop and displays them on the terminal.
If you are using Jetson Orin NX and Jetson Orin Nano motherboards, you need to change the serial port device number to /dev/ttyTHS0, and you can communicate normally after running the program.
xxxxxxxxxx
sudo apt install cutecom
sudo cutecom
You can see cutecom is open Generally, no settings are required, just click open to use it, then enter text through InPUT, and press Enter to send the content. The effect is as shown in the figure:
If you use the USB to TTL module to communicate between the computer and nano, pay attention to the following points