Welcome to Firefly
English
Firefly Docsss
Last Updated: 2026-11-18 14:24:01

UART Usage

Introduction

Firefly-R3572A provides two kinds of serial ports: the J3 Debug connector is the debug console using the m0 pin multiplexing of the UART0 controller, and UART2 is available on the J1 double-row pin header for application communication. Additional UART resources can be enabled in the SDK as required.

Debug Console (UART0 m0)

The J3 Debug connector is used as the system debug console by default at 1500000 baud. For wiring and usage, refer to Debug Usage.

Note

The debug console outputs system logs. Do not attach application devices to it, to avoid interference with the system log output.

Expansion UART (UART2)

UART2 is available on the J1 double-row pin header with the following pin definition:

Pin NO.SignalLevel
17UART2_TX (series resistance 22R)3.3 V
19UART2_RX (series resistance 22R)3.3 V
5 / 6GND

DTS Configuration

Enable the UART2 controller in the board-level DTS (the pinctrl group depends on the SDK code):

&uart2 {
    status = "okay";
    pinctrl-0 = <&uart2m2_xfer_pins>;
};

Transceiver Test

After the configuration, the system creates the serial device node /dev/ttyS2 (the node number depends on the actual configuration). Short the UART2_TX and UART2_RX pins on the J1 header, then run the following commands on the debug console or through ADB:

busybox stty -echo -F /dev/ttyS2          # Disable echo
cat /dev/ttyS2 &                          # Read input in the background
echo "firefly uart test..." > /dev/ttyS2  # Send a string

Receiving the string firefly uart test... in the terminal confirms that the transceiver works.

On this page