Use UART

Edge 2 has two UART interfaces, UART3 and UART5.

Connecting hardware

Port the USB to UART converter to the PC, and connect the cable to the edge2 UART3/UART5 connector. Refer to the following wire sequence connection diagram:

uart-connection

Testing UART

Open the PC serial port

Taking macOS as an example, the USB to UART converter node tty.usbserial-AQ01C9CC% exists in the system, and the command to open it through the picocom tool is as follows:

$ picocom -b 9600 /dev/tty.usbserial-AQ01C9CC% 

The USB to UART converter node exists in the Ubuntu in the form of /dev/ttyUSB[1, 2, 3.....].

The USB to UART converter node exists in the Windows in the form of COM[1、2、3....].

For more details, please refer to the Serial Debugging.

Sending data from Edge 2

The Edge 2 UART5 device file is /dev/ttyS5. Run the following commands on Edge 2:

echo "edge2 UART5 test..." > /dev/ttyS5

The PC serial terminal (picocom) should receive the string "edge2 UART5 test...".

Receiving data with Edge 2

Run the following command on edge2:

cat /dev/ttyS5

Send a string, e.g. “edge2 UART5 test…”, using the PC serial terminal (picocom) to test the connection. Edge 2 should see the same string.

Note: UART3 usage is the same as UART5.

Configuring UART

[Note]: The Android / Debian released by Mixtile already enabled the UART function in the kernel, so you could just ignore the below instruction. If you plan to compile your Andorid / Debian system, please remember to configure UART as below.

To use Edge 2 UART3 and UART5, you need to enable UART3 and UART5 in the dts of the kernel.

The following file is involved in the kernel:

kernel/arch/arm64/boot/dts/rockchip/mixtile-edge2.dts

To enable UART3 and UART5:

&uart3 {
    status = "okay";
    pinctrl-0 = <&uart3m1_xfer>;
};

&uart5 {
    status = "okay";
    pinctrl-0 = <&uart5m1_xfer>;
};

To compile the kernel, please refer to the Compile kernel chapter for details.

To burn boot.img, please refer to Update Firmware chapter for details.

Was this article helpful?

Related Articles