• 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: pcb800099-v.9 ESP32-P4-NANO Development Board RISC-V WiFi6 MIPI CSI Camera / 10.1 inch DSI Display / USB / RJ45 Ethernet / POE / Audio Buzzer Raspberry Pi Pico 2 RP2350 Core2350B Core Board PSRAM Spotpear USB-CAN-B Capacitive Touchscreen 2.8inch Capacitive TouchScreen LCD Display ST7789 CST328 240x320 For Arduino/Raspberry Pi/ESP32/Pico Jetson Orin 5G/4G/3G expansion board GNSS GPS SIM8260G-M2 SIM8262E-M2 Round Rotary LCD touch screen 1.28inch 1.6inch 2.1inch Knob central control lighting LCD Magnetic Encoder Servo Motor 45KG.CM 24V 360° RS485 High Precision And Large Torque Raspberry Pi 5 PCIe to M.2 NVME SSD And Gigabit Ethernet RJ45 HAT RTL8111H M_KEY For 2230/2242/2260/2280 RS232 to RS422 ESP32 S3 4inch LCD Development Board 480x480 TouchScreen Display TVBOX LVGL HMI Sensor CAN RS485 Raspberry Pi 13.3 inch FHD AMOLED 1080P Capacitive TouchScreen Display Type-C/HDMI For Computer PC Raspberry Pi 5 Serial RDK X5 PoE Module For Power Over Ethernet/ IEEE 802.3af/at PoE For D-Robotics RDK X5 Industrial Isolated Converter NVIDIA Raspberry Pi 5 PCIe to M.2 NVMe SSD Adapter Board (D) HAT Pi5-2280-2242-2230 Raspberry Pi PICO