This section tests the tutorial of Jetson Orin NX serial port sending and receiving on its own. From the figure below, it can be seen that the TXD and RXD pins of the serial port of the Jetson Orin NX correspond to physical pins 8 and 10, respectively.
Wiring: Jetson Orin NX pin 8(TXD)→Jetson Orin NX pin 10(RXD)
Enable the serial port permission. Please note that this permission will also be disabled after shutdown, and you need to restart it next time
sudo chmod 777 /dev/ttyTHS1
Download a serial communication case from Github, the source code and explanation can be viewed through this Github connection
xxxxxxxxxx
git clone <https://github.com/JetsonHacksNano/UARTDemo>
Enter folder
xxxxxxxxxx
cd UARTDemo
If you do not intend to use the serial console on UART, you should disable the serial console (it may not be a personal choice):
xxxxxxxxxx
systemctl stop nvgetty
systemctl disable nvgetty
udevadm trigger
Install the serial module
xxxxxxxxxx
sudo apt-get install python3-serial
Terminal input running program:
xxxxxxxxxx
sudo python3 uart_example.py
After running, you can see the characters in the "NVIDIA Jetson Orin NX Developer Kit" sent by the Jetson Orin NX loop and displayed on the terminal.
1.Testing using Yahboom routines
xxxxxxxxxx
sudo apt install cutecom
sudo cutecom
You can see that the cutecom is open Generally, there is no need for settings. Simply click on open to use it, and then input text through Input. Press the Enter key to send the content. The effect is as shown in the picture:
1.Testing using Yahboom routines
xxxxxxxxxx
cd ~/GPIO_test
python3 test_serial_810.py #If there is no such program, transfer it from the attachment of the data to orin nx
The phenomenon can be seen and any message sent can be replied to
If using a USB to TTL module for communication between a computer and Orin nx, please note the following points 1.DuPont cable should not be too long, as it will cause garbled code 2.The situation of only receiving but not sending is caused by insufficient voltage. Connect the 5V port of the USB to TTL module to the 5V port of the nano 3.If the line is reasonable but garbled, check whether the baud rate, parity, and stop bit are consistent 4.Other case:https://blog.csdn.net/lxj362343/article/details/89646731