Verification

This section describes the verification of running AMP on VisionFive 2 or VisionFive 2 Lite. The verification covers the following:
  • Communication between Linux and RT-Thread via RPMsg Protocol
  • RT-Thread drivers
  • Performance

Inter-processor Communication (RPMg)

Verify RPMsg (Remote Processor Messaging) communication between Linux and RT-Thread domains.

Test Setup:
  • Boot AMP system (Linux on 3 cores + RT-Thread on 1 core)
  • Connect to both Linux console (UART0) and RT-Thread console (UART2)
  • Flash sdcard_amp.img to SD card
Verification Process:
  1. Power on: RT-Thread starts first and waits at the main program for an IPI interrupt from Linux.
  2. Linux boots and registers virtio_rpmsg_bus and starfive_rpmsg drivers register, and then send an IPI interrupt to RT-Thread.
  3. RT-thread receives the interrupt and continues execution.
  4. Verify IP interrupts are counted:
    # On Linux console
    cat /proc/interrupts
    Figure 1. IPI Interrupt Verification Example
  5. Run the echo test program rpmsg_echo:
    # On Linux console
    rpmsg_echo
    
    RVspace provides the compiled applications and source code. This application sends a string to the remote side of RPMsg, After receiving it, RT-Thread sends the received string back to Linux, and the test result is shown below:
    Figure 2. rpmsg_echo Test Result

GPIO Driver

Verify GPIO pin control (input/output) and GPIO interrupt functionality.

Test Setup:
  • Connect to RT-Thread console (UART2)
  • Use GPIO47 as test pin

Verification - GPIO Control

# Set GPIO47 as output
pin mode 47 output

# Write low level
pin write 47 low
pin read 47
# Output: pin[47] = low

# Write high level
pin write 47 high
pin read 47
# Output: pin[47] = high

Verification - GPIO Control

Only one GPIO interrupt resource exists on JH-7110. Since Linux uses it in the default SDK configuration, RT-Thread does not enable GPIO interrupt by default. To activate it, enable BSP_USING_GPIO in the RT-Thread menuconfig.

GMAC Driver

Verify Ethernet connectivity using GMAC1 (assigned to RT-Thread in AMP configuration) with lwIP TCP/IP stack.

Test Setup:
  • Ethernet cable to the GMAC1 port
  • Boot AMP system
Verification Process:
  1. RT-Thread initializes GMAC driver during boot.
  2. GMAC driver registers with lwIP TCP/IP stack.
  3. DHCP client starts automatically.
  4. IP address is obtained from DHCP server.
  5. Test network connectivity:
    # On RT-Thread console
    ping www.baidu.com
  6. Check network interface status:
    ifconfig

PCIe Driver

JH-7110 integrates two PCIe 2.0 host controllers. Each controller supports a theoretical maximum speed of 500 MB/s. The RT-Thread PCIe driver has been ported to the RTOS side to support real-time communication with PCIe devices.
Note: The driver supports single device per PCIe bus only. It does not support multi-device configurations with PCIe switches.

UART Driver

Verify UART communication and console functionality.

Test Setup:
  • Connect to RT-Thread console (UART2, 115200 baud)
  • For UART5 test: connect PC serial debugging assistant to UART5

Verification Process:

To verify the UART function, use either of the following two methods:
  • Console Output: After connecting and debugging the serial port, display the system output content and interact with the input commands.
    For example, enter the command ps to display the currently running threads of the system.
  • UART5 Test: RT-Thread sends a string every second via UART5 and the debugging assistant receives that string.

I2C Driver

Verify I2C bus communication with external devices.

Test Setup:
  • Connect Sense HAT to VisionFive 2 via 40-pin GPIO header. For example:
  • I2C pins used: GPIO2 (SDA) and GPIO3 (SCL)
Test Program Location:
rtthread/bsp/starfive/jh7110/applications/i2c_test.c
Verification Process:
  1. Connect Sense HAT to VF2 board.
  2. Run I2C test program on RT-Thread console.
  3. Program reads Sense HAT device ID via I2C bus.

SPI Driver

Verify SPI bus communication with Flash device.

Test Setup:
  • Connect SPI Flash module to VisionFive 2 via GPIO header
  • SPI pins: MOSI, MISO, SCLK
Test Program Location:
rtthread/bsp/starfive/jh7110/applications/spi_test.c
Verification Process:
  1. Connect SPI Flash to VF2 board.
  2. Run SPI test program.
  3. Program reads Flash ID, performs erase/write/read operations.
  4. Compares written and read data.

QSPI Driver

Verify QSPI Flash read/write operations.

Test Program Location:
rtthread/bsp/starfive/jh7110/applications/qspi_test.c
Verification Process:
  1. Run QSPI test program on RT-Thread console.
  2. Program accesses QSPI Flash device on VisonnFive 2.
  3. Performs erase, write, and read operations.
  4. Compares written and read data.

PWM Driver

Verify PWM signal generation with configurable period and duty cycle.

Test Program Location:
rtthread/bsp/starfive/jh7110/applications/pwm_test.c
Verification Process:
  1. Run PWM test program on RT-Thread console.
  2. The test program sets the PWM duty cycle.
  3. Measure PWM signal with oscilloscope.

Timer Driver

Access the hardware timer device via the I/O device management interface provided by RT-Thread.

Test Program Location:
rtthread/bsp/starfive/jh7110/applications/timer_test.c
Verification Process:
  1. Run the timer test program.
  2. Set the timer timeout to 1 second and 10 microseconds.
  3. Timer callback function is invoked at each timeout.

Watchdog Driver

Verify watchdog timer reset functionality.

Test Program Location:
rtthread/bsp/starfive/libraries/driver/drv_wdt.c
Verification Process:
  1. Run the watchdog test program
  2. Start the watchdog device and set the timeout value to 1 second.
  3. Feed the dog within 1 second to prevent reset.

RTC Driver

A RTC (Real-Time Clock) provides accurate real-time clock time, which can be used to generate information such as year, month, day, hour, minute, and second. Verify the RTC time setting and reading.

Test Program Location:
rtthread/bsp/starfive/libraries/driver/drv_rtc.c
Verification Process:
  1. Run the RTC test program.
  2. Set the current time to a specific value, for example, 2025-05-19 13:29:35.
  3. Wait for 1 second.
  4. Read the current time from the RTC.

Temperature Sensor Driver

Verify the reading of the current CPU temperature.

Test Program Location:
rtthread/bsp/starfive/libraries/driver/drv_tempsensor.c
Verification Process:
  1. Run the temperature sensor test program.
  2. Read the CPU temperature.
  3. Press your finger on the CPU and run the program to see the temperature change.

TRNG Driver

Verify hardware random number generation in three modes.

Test Program Location:
rtthread/bsp/starfive/libraries/driver/drv_trng.c
Verification Process:
  1. Run the TRNG test program.
  2. Test generates random numbers in three modes:
    • Interrupt mode: Triggers an interrupt once random number generation is complete.
    • Polling mode: Queries status register to retrieve data.
    • Nonce mode: Outputs 32-bit random numbers in batch.

SDIO Driver

The JH-7110 SoC is equipped with two SDIO interfaces. By default, SDIO0 is used for eMMC, while SDIO1 is reserved for SD cards or peripherals such as Wi-Fi. On the RT-Thread side, SDIO1 is the interface in use.

The RTOS includes an SDIO driver, with its files located at the following paths:
  • rtthread/bsp/starfive/libraries/driver/drv_sdmmc.c
  • rtthread/bsp/starfive/libraries/hal/sdmmc
Verification - SD Card Operations:
Table 1. SD Card Operations
Operation Command Description
Mount SD card to root directory # mount SDIO1 / elm Mounts the SD card to the root directory.
Unmount SD card # umount / Unmounts the SD card from the root directory.
Copy file to SD card # cd # echo “12345” test.txt/ Navigates to the root directory, and then creates a file test.txt with content "12345" (saves to the mounted SD card).
Delete file from SD card # cd /# rm test.txt Navigates to the root directory, and then deletes the test.txt file from the SD card.
Create sub-directory # cd / # mkdir mnt Navigates to the root directory, then creates a subdirectory mnton the SD card. Successful execution confirms normal device mount/unmount and read/write functions.
Format SD card as FATFS # mkfs -t elm SDIO1 Formats the SD card to the FATFS file system. Execution duration varies based on the SD card’s capacity and speed class.

CAN Driver

The VisionFive 2 board does not have a CAN transceiver. This test must be performed on the DevKit board.

Test Setup:
  • Connect a USB-CAN device to CANO on the DevKit board. For example:

  • GCAN Tools software on PC

Test Program Location:

The RTOS includes a CAN driver and a corresponding test program which are located at:
  • rtthread/bsp/starfive/libraries/driver/drv_can.c
  • rtthread/bsp/starfive/libraries/hal/can/
  • rtthread/bsp/starfive/jh7110/applications/can_test.c
Verification Process:
  1. Connect the USB-CAN adapter to PC.
  2. Connect CAN0 on the DevKit board to the USB-CAN adapter.
  3. Run the CAN test program on the RT-Thread console.
  4. Use the GCAN Tools on PC to send data frame via CAN bus.
    Figure 3. GCAN Tools
  5. RT-Thread receives and processes the data.
    Figure 4. CAN Test Case

Performance

The performance of the AMP system is verified by a schedule delay test and a interrupt delay test.
Table 2. Performance Tests
Test Test Condition Test Result
Schedule Delay
  • U74 core frequency: 1.5 GHz
  • Idle state runtime: 12 hours

The average delay is less than 1us, and the maximum delay is 2us.

When working with an Ethernet card and in promiscuous mode, the maximum latency is 10us.

Interrupt Delay Test the RX delay of UART at 1.5GHz, from receive > interrupt > finish shell process receives characters. The whole process takes about 6us.