Compile and Install OpenWrt on VisionFive 2

This image version has passed internal testing, accesses ipv4\ipv6; accesses the network through direct connection or switch, router; supports real-time information, network diagnosis, and other network monitoring functions; and supports Passwall module. You can also install various plug-ins and configures Samba server, to meet your different development requirements.

The following instructions provide the user with the method to compile and install OpenWrt on VisionFive 2.


1. Download the code:

git clone

Note: It is recommended to compile in Ubuntu system release 20 or above.

2. Execute the following command to enter wigyori directory:

cd wigyori/

3. Execute the following command to checkout the image:

git checkout riscv-jh71x0-202308b


1. Execute the following command to enter the menu configuration GUI:

make menuconfig

In the menu configuration GUI, follow the steps to select the corresponding option:

a. In OpenWrt Configuration, select Target System and Target Profile

→ Target System (StarFive JH71x0 (7100/7110))
→ Target Profile (StarFive VisionFive 2 v1.2a) or Target Profile (StarFive VisionFive 2 v1.3b)

Note: VisionFive 2 currently has 2 versions, v1.2a and v1.3b.

b. In OpenWrt Configuration, select Root filesystem archives under Target Image:

2. Luci configuration:

a. Execute the following command to install luci:

./scripts/feeds update packages luci
./scripts/feeds install -a -p luci

b. Execute the following command to enter the menu configuration GUI to configure luci:

make menuconfig

c. Select uhttpd in the configuration menu bar in the following order:

→ Network → Web Servers/Proxies → <*> uhttpd

d. Select luci in the configuration menu bar in the following order:

→ LuCI → 1. Collections → <*> luci

→ LuCI → 3. Applications → <> luci-app-ddns
> luci-app-firewall
<> luci-app-ntpc
> luci-app-samba4
<*> luci-app-uhttpd

→ LuCI → 4. Themes → Select all

3. Wireless Configuration

Due to the lack of WiFi modules on VisionFive 2, you need to purchase a WiFi Dongle. OpenWrt supports dozens of WiFi drivers, and the RTL8821AE PCI interface driver, which is easier to purchase, is chosen here. On VisionFive 2, there is an M.2 M-key interface, which needs to be connected to the NVME M.2 M-key to a/e key interface board to connect to the RTL8821AE module.

In the menu configuration GUI, follow the steps to configure wireless connection:

a. → Kernel modules → Wireless Driver → <> kmod-cfg80211
> kmod-mac80211
<*> kmod-rtl8821ae

b. → Network → WirelessAPD → <> wpad-basic-mbedtls
> hostapd-common
<> wpa-cli
> hostapd-utils

4. Execute the following command to download the dependency packages:

./scripts/feeds update -a
./scripts/feeds install -a
make download V=s

Note: The download process may take a long time, please be patient. If a “download fail” error occurs during the process, it indicates that the software package has not been fully downloaded. Please execute the above command again until no “download fail” occurs.

5. Execute the following command to compile:

make -j8

Note: The compilation may take 2 hours.

6. Execute the following command to generate an SD card image:


7. Unzip the SD card image:

gunzip openwrt-jh71x0-generic-visionfive2-v1.3b-ext4-sdcard.img.gz

8. Flash the image into the SD card:

dd if=openwrt-jh71x0-generic-visionfive2-v1.3b-ext4-sdcard.img of=/dev/sdX bs=1M


  • For Windows, you can use balenaEtcher to flash the image.

  • Since the image does not include SPL and U-Boot, Nor Flash needs to have SPL and U-Boot flashed and should boot with QSPI Nor Flash.

  • Use the sudo fdisk –l command to find your device so that you can replace X value. For exmple, if your device is /dev/sdb, X should be b.

9. Open OpenWrt.

10. Add passwall function.

Follow the steps below to add the passwall function. The passwall function is not included in the default function and requires code modification and package download support.

a. Execute the following command under wigori directory:

echo "src-git passwall_packages;main" >> "feeds.conf.default"
echo "src-git passwall;main" >>

b. Modify include/

diff --git a/include/ b/include/
index b5e3e7ff6f..f65e127ecf 100644
--- a/include/
+++ b/include/
@@ -53,7 +53,7 @@ DEFAULT_PACKAGES.nas:=\
# For router targets
-            dnsmasq \
+           dnsmasq-full \

c. Download and install the package of passwall:

./scripts/feeds update -a
./scripts/feeds install -a
./scripts/feeds install -a -f -p PWpackages
./scripts/feeds install luci-app-passwall

d. Configure passwall and unconfigure dnsmasq:

make menuconfig

Configure passwall:

→ OpenWrt Configuration → LuCI → 3. Applications → <*> luci-app-passwall

Unconfigure dnsmasq:

→ OpenWrt Configuration → Base system → < >dnsmasq
→ OpenWrt Configuration → Base system → -*- dnsmasq-full

e. Execute the following command to update and download software package:

make download V=s

f. Compilation:

The same as step 5。


It is good to know that there is SOME progress in the issue of fulfilling the router/gateway function promise given at the public introduction of the Vision Five 2 (3 Gigabit Ethernet ports would have been nice though, instead of only 2 Gigabit Ethernet ports for a DMZ configuration in full control of the Vision Five 2 machine not needing an extra OpenWRT box for its subnets). Though, the capabilities of the Vision Five 2 exceed by far that of an OpenWRT router and it would be a waste of its potential to make it an OpenWRT router box. I bought it to make it a DMZ (DMZ (computing) - Wikipedia) gateway and router as well as DMZ server and comfortably accessible machine. A working nftables kernel firewall and IP packet routing support in the debian-202308 image would have already done that job, but the starfive-5.15.0 kernel in the debian-202308 image does not support the nftables kernel firewall subsystem, which is quite pity.

PDF version of this tutorial:

Hi there, I confirmed with software engineers that nftables is suppoted and enabled in the kernel. Please check if you encounter any other issue that stops it from working.

Able to build the openWRT image. We have completed the steps given in this up to step 8 (Flash the image into the SD card).
Also we have flashed with SPL and uBoot as you have mentioned.
The board is not booting up successfully.
can you please provide steps to bring up openWRT with the builded image.