This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Tutorials

Show your user how to work through some end to end examples.

Tutorials.

1 - Compiling the StarFive VisionFive 2 Kernel

How to compile kernel 6.1x for StarFive VisionFive 2.

Hi, Here’s how to compile kernel 6.1x for StarFive VisionFive 2.

Install dependencies :

Manjaro / Arch Linux :

pacman -S --needed ncurses openssl bc flex bison make gcc riscv64-linux-gnu-gcc git

Ubuntu / Debian :

apt install -y libncurses-dev libssl-dev bc flex bison make gcc gcc-riscv64-linux-gnu git

Fedora / CentOS :

yum install -y ncurses-devel openssl openssl-devel bc flex bison make gcc gcc-riscv64-linux-gnu git

Download the sources : (Official)

git clone https://github.com/starfive-tech/linux
cd linux || exit
git checkout JH7110_VisionFive2_6.1.y_devel

Download the sources : (Unofficial)

git clone https://github.com/MichaIng/linux
cd linux || exit
git checkout 6.1-visionfive2

Compile the Kernel : (Cross Compilation)

make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- starfive_visionfive2_defconfig
make ARCH=riscv -j$(nproc) CROSS_COMPILE=riscv64-linux-gnu-

Compile the Kernel : (On Debian x86_64)

cp arch/riscv/configs/starfive_visionfive2_defconfig .config
make ARCH=riscv olddefconfig CROSS_COMPILE=riscv64-linux-gnu-
make ARCH=riscv -j$(nproc) CROSS_COMPILE=riscv64-linux-gnu- bindeb-pkg

Compile the Kernel : (On Debian Riscv64)

cp arch/riscv/configs/starfive_visionfive2_defconfig .config
make ARCH=riscv olddefconfig
make ARCH=riscv -j$(nproc) bindeb-pkg

Install the Kernel :

dpkg -i *.deb

2 - StarFive VisionFive 2 Upgrade Firmware

How to Flash the StarFive VisionFive 2 Firmware.

Hi,

Here’s how to Flash the StarFive VisionFive 2 Firmware

Install mtd :

apt update && apt install mtd-utils -y

Download Firmware :

wget https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v3.8.2/u-boot-spl.bin.normal.out
wget https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v3.8.2/visionfive2_fw_payload.img

Check MTD :

cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00040000 00001000 "spl"
mtd1: 00010000 00001000 "uboot-env"
mtd2: 00300000 00001000 "uboot"
mtd3: 00100000 00001000 "data"

Flash Firmware :

flashcp -v u-boot-spl.bin.normal.out /dev/mtd0 (SPL)
flashcp -v visionfive2_fw_payload.img /dev/mtd2 (Uboot)

There you have flashed the firmware.

Useful link : https://github.com/starfive-tech/VisionFive2/releases