Configure and Debug UART

Configure dts File

Configure the jh7110-visionfive-v2.dtsi file that is under /linux/arch/riscv/boot/dts/starfive.

Up to 6 channels are supported form UART.

To modify the dts file:
  1. Add aliases of uart1 or uart2 on the aliases node. The following is an example:

    Figure 1. Alias Example
  2. Add uart1 or uart2 node on the dts. The following is an example:

    Figure 2. Node Example
  3. Add uart1_pins or uart2_pins node on the &gpio node.

    Figure 3. &gpio Example

Debug UART Send and Receive Function

To debug the UART send the receive function:
  1. Set up the hardware.
    1. Connect the jumper wires from the USB-to-Serial Converter to the 40-Pin GPIO header of the VisionFive 2 as follows.

      Figure 4. Connect the Converter to the Header
    2. Connect the other end of the USB-to-Serial Converter to your device (Windows/Mac/Linux).

  2. Configure VisionFive 2 minicom.
    sudo minicom -s
  3. Select Serial port setup, and configure minicom as follows.

    Figure 5. Example Configuration
  4. Start VisionFive 2 minicom.
    minicom -o -D /dev/ttyS1
  5. Configure Ubuntu minicom.
    sudo minicom -s
  6. Select Serial port setup, and configure minicom as follows.

    Figure 6. Example Configuration
    Note: Serial Device can be detected by the dmesg | grep tty command on Ubuntu.
  7. Start Ubuntu minicom.

  8. To test the UART send function, you can enter characters, such as hello ubuntu, on the VisionFive 2 minicom. Then you can see the character are outputted on the Ubuntu minicom as follows.

    Figure 7. Test UART Send

    The figure on the left is the Ubuntu minicom interface, and the other is the VisionFive 2 minicom interface.

  9. To test the UART receive function, you can enter characters, such as hello visionfive on the Ubuntu minicom. Then you can see the characters are outputted on the VisionFive 2 minicom.

    Figure 8. Test UART Receive

    The figure on the left is the Ubuntu minicom interface, and the other is the VisionFive 2 minicom interface.