Preparation

Before executing a demo program, make sure you prepare the environment requirements, hardware, and software.

Environment Requirements

  • Linux Kernel: Linux 6.6
  • OS: Debian 13
  • SBC: VisionFive 2 or VisionFive 2 Lite
  • SoC: JH-7110

Hardware

Table 1. Hardware Preparation
Type M/O* Item Notes
General M VisionFive 2 Board or VisionFive 2 Lite Board -
General M
  • 32 GB (or more) micro-SD card
  • Micro-SD card reader
  • Computer (Windows/Mac OS/Linux)
  • USB to serial converter (3.3 V I/O)
  • Ethernet cable
  • Power adapter (5 V / 3 A)
  • USB Type-C Cable
These items are used for flashing Debian OS into a Micro-SD card.
I2C Demo M
  • Sense Hat (B)
  • Dupont Line
Required for Read SHTC3 Data only
UART Demo M
  • NEO-6M GPS
  • 4 Dupont lines (female to female)
  • An external antenna (Optional)
Required for Read GPS Data only
GPIO Demo (Buzzer) M A passive buzzer Required for Make a Buzzer Beep only
GPIO Demo (LED) M
  • An LED
  • A Breadboard
  • Two Male-Female jumper wires
  • 470 Ω color ring resistor
Required for:
GPIO Demo (LED Matrix) M MAX7219 Serial Dot Matrix Display Module (with a 5-way female to female Dupont cable) Required for LED Dot Matrix Display only
SPI LCD M
  • 2.4inch LCD Module
  • Dupont Line
Required for LCD Display only
Button Detection Demo M
  • An LED
  • A Breadboard
  • Two Male-Female jumper wires
  • A 4-pin button
Required for Basic Edge Detection and Edge Detection with Timeout Setting only
LED Dot Matrix Display (with Button) M
  • An LED
  • A Breadboard
  • Seven Male-Female jumper wires
  • A 4-pin button
  • MAX7219 Serial Dot Matrix Display Module
Required for Use a Button to Control LED Dot Matrix only
Object Detection M Monitor and accessories:
  • An HDMI monitor
  • An HDMI cable

Required for Detect Objects only

For the compatible USB cameras, see JH7110 AVL.

M Camera and accessories:
  • A USB camera
  • A IMX219 MIPI camera
M A USB keyboard
O A USB mouse
Note: M: Mandatory; O: Optional

Software

Make sure the following procedures are performed:
Note: This section is not applicable to the running Docker or object detection demo programs. For software preparation of these programs, see Run Docker or Detect Objects.
  1. Flash Debian OS into a Micro-SD card as described in Flash OS to a Micro-SD Card.
  2. Log into the Debian and make sure VisionFive 2 or VisionFive 2 Lite is connected to the Internet. For details, see Log into Debian.
  3. Execute the following command to install and create a Python3 Virtual Environment on Debian:
    sudo apt install python3-venv
    python3 -m venv myvenv
    
    Note: You may rename “myvenv” according to your preference.
  4. Execute the pip command on VisionFive 2 or VisionFive 2 Lite Debian to install the VisionFive.gpio package:
    Note: Due to the fact that pypi.org official website does not yet support uploading whl installation packages for the RISC-V platform, so it cannot directly execute python3 -m pip install VisionFive.gpio command to install online.

    Follow the steps below to install the VisionFive.gpio package.

    1. Execute the following command to install dependent package within the newly created virtual environment:
      sudo apt install libxml2-dev libxslt-dev 
      source ./myvenv/bin/activate
      python3 -m pip install requests wget bs4
      
    2. Execute the following command to run the installation script Install_VisionFive_gpio.py:
      python3 Install_VisionFive_gpio.py
      The installation script codes are as follows:
      import sys, os, requests
      
      PACKAGE = "VisionFive.gpio"
      PLATFORM = "linux_riscv64"
      
      def py_abi():
      return f"cp{sys.version_info.major}{sys.version_info.minor}"
      
      def fetch_latest_wheel():
      url = f"https://pypi.org/pypi/{PACKAGE}/json"
      data = requests.get(url).json()
      version = data["info"]["version"]
      files = data["releases"][version]
      abi = py_abi()
      for f in files:
      name = f["filename"]
      if name.endswith(".whl") and abi in name:
      return f["url"], name
      raise RuntimeError(f"No wheel found matching ABI {abi}")
      
      def rewrite_platform(name):
      base, ext = os.path.splitext(name)
      parts = base.split("-")
      parts[-1] = PLATFORM
      return "-".join(parts) + ext
      
      def download(url, path):
      with requests.get(url, stream=True) as r:
      r.raise_for_status()
      with open(path, "wb") as f:
      for chunk in r.iter_content(8192):
      f.write(chunk)
      
      def main():
      url, orig = fetch_latest_wheel()
      newname = rewrite_platform(orig)
      print(f"Downloading: {url}")
      download(url, newname)
      print("Installing...")
      os.system(f"pip install {newname}")
      os.remove(newname)
      print("Done.")
      return 0
      
      if name == "main":
      sys.exit (main())
    3. (Optional) Exit the Python3 Virtual Environment.
      deactivate