• sales

    +86-0755-88291180

Luckfox Pico RV1103【Tutorial on how to use UART】



The LuckFox Pico has three serial ports: UART2, UART3, and UART4. Among them, UART2 is the debug port.

The LuckFox Pico Plus has four serial ports: UART2, UART3, UART4, and UART5. Among them, UART2 is the debug port.

Performing serial port testing using the GPIO sysfs interface
1] View serial port:

root@linaro-alip:/home/linaro# ls /dev/ttyS*
/dev/ttyS3  /dev/ttyS4
##The serial port devices here are UART3 and UART4

2] Use the “stty” tool to query the serial port communication parameters:

linaro@linaro-alip:~$ stty -F /dev/ttyS3
speed 9600 baud; line = 0;
-brkint -imaxbel
##The default baud rate is 9600 

3] Modify the baud rate, where ispeed is the input rate and ospeed is the output rate:

stty -F /dev/ttyS3 ispeed 115200 ospeed 115200

4] Disable echo:

stty -F /dev/ttyS3 -echo
## Disabling echo refers to the situation where the characters entered in the terminal or serial communication are no longer displayed on the terminal.

5] Operation process screenshot:




】Communicating with a Windows host:

Connect one end of the serial port module to the computer, and the other end to the physical pins 18 (GND), 19 (UART7_TX), and 20 (UART7_RX) of the LuckFox Pico.

Download and open PuTTY (or any other serial port software), select the serial port, and set the baud rate (default is 9600, please adjust it according to your actual modified value).

Execute the following command on the terminal of the development board to write the strings “Hello” and “world!” to the terminal device file using the echo command:


echo Hello > /dev/ttyS3
echo "world !" > /dev/ttyS3

The serial port debugging assistant on Windows will receive the content:


】Test the built-in sample program of the official SDK:


(The following operations need to be performed in the terminal of the Pico development board)

3] Run the test sample program:
chmod 777 ./luckfox_uart_test
## Grant executable permissions to the file
./luckfox_uart_test 3
##The parameter 3 in the example represents UART3.

4] Open the serial communication device to receive data:


TAG: Pi5-Active-Cooler-C Modbus RTU Jetson Orin 4G/3G/2G expansion board GNSS GPS SIM7600G-H-M.2 Jetson Nano Expansion Board Raspberry Pi 3.5 inch DSI Display MIPI LCD (H) Capacitive TouchScreen 480x800 Raspberry Pi GPS GNSS Expansion Board L76K Beidou (BDS) GLONASS QZSS A-GNSS Also For Jeston Industrial SpotPear Digital Photo MPS2280D Raspberry Pi 5 PCIe to M.2 NVMe Dual SSD Adapter Board HAT Pi5 Double 2280 Tuya AI Voice Robot T5-E1 1.75 inch Round AMOLED TouchScreen GPS For XiaoZhi Development Board Raspberry Pi 3.5 inch LCD F Display Capacitance TouchScreen 60fps ST7796 GT911 320x480 Also For Arduino/Pico2/ESP32/RP2040/RP2350 Raspberry Pi 5 PCIe to USB3 HUB Double 2.5G ETH RJ45 and M.2 NVMe SSD PI5 Expansion board HAT+ Arduino 0.85inch LCD Raspberry Pi Zero 2W Dual Ethernet Expansion Board USB Hub Expansion RJ45 ESP32 C3 Thermal imaging camera USB TO 2.5G Ethernet Port Converter RJ45 RTL8156B Driver-Free For Windows/macOS/Linux/Android Industrial USB TO 4CH RS232/485/422/TTL Serial UART Converter FT4232HL Industrial UART USB TO 8CH RS485 Isolated Converter For 35mm standard rail and stacked installation