VF2 Debian 69 to 202302 eMMC

For those who are interested in upgrade from debian-69 to 202302 I’m sharing my notes:
Everything should be the same for SD card except fdisk (which will do online resize)

I booted older image with:

  1. UART connected

  2. ethernet and assigned IP

  3. fan & heatsink, eMMC 32GB module, nvme

  4. connected via IP and downloaded new image to PC and moved it via sftp to board, for bootloader and u-boot there are links to github, but not for debian image, please share it in future so it can be directly downloaded via command line with wget.

  5. decompressing image:

bzip2 -d starfive-jh7110-202302-eMMC-minimal-desktop.img.bz2
  1. at this stage lsblk looks like this:
root@starfive:~# lsblk
mtdblock0     31:0    0   128K  0 disk
mtdblock1     31:1    0     3M  0 disk
mtdblock2     31:2    0     1M  0 disk
mmcblk1      179:0    0  29.1G  0 disk
|-mmcblk1p1  179:1    0    16M  0 part
|-mmcblk1p2  179:2    0   100M  0 part /boot
`-mmcblk1p3  179:3    0  15.5G  0 part
mmcblk0      179:8    0  28.9G  0 disk
|-mmcblk0p1  179:9    0    16M  0 part
|-mmcblk0p2  179:10   0   100M  0 part
`-mmcblk0p3  179:11   0  15.5G  0 part
mmcblk0boot0 179:16   0     4M  1 disk
mmcblk0boot1 179:24   0     4M  1 disk
nvme0n1      259:0    0 232.9G  0 disk
`-nvme0n1p1  259:1    0 232.9G  0 part /

(boot from sd card mmcblk1, eMMC as mmcblk0 with some earlier image, nvme not used at this time)
4. ok, lets burn eMMC new image:

root@starfive:~# sudo dd if=~/starfive-jh7110-202302-eMMC-minimal-desktop.img of=/dev/mmcblk0 bs=4M status=progress
2252341248 bytes (2.3 GB, 2.1 GiB) copied, 16 s, 140 MB/s
550+0 records in
550+0 records out
2306867200 bytes (2.3 GB, 2.1 GiB) copied, 39.4746 s, 58.4 MB/s
  1. sync drive information:
root@starfive:~# sync
  1. burned image is 2GB in size so last partition needs to be adjusted with fdisk, basically by deleting and recreating last (4) partition at same place with its signature:
root@starfive:~# fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

GPT PMBR size mismatch (4505599 != 62929919) will be corrected by write.
Command (m for help): d
Partition number (1-4, default 4): 4  

Partition 4 has been deleted.

Command (m for help): n
Partition number (4-128, default 4): 4
First sector (34-62929886, default 221184):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (221184-62929886, default 62928895):

Created a new partition 4 of type 'Linux filesystem' and of size 29.9 GiB.
Partition #4 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: N

Command (m for help): w

The partition table has been altered.
Syncing disks.
  1. time to update mtd, I got utils earlier with apt install mtd-utils
root@starfive:~# wget -q https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.10.4/u-boot-spl.bin.normal.out
root@starfive:~# wget -q https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.10.4/visionfive2_fw_payload.img
  1. checking image hashes:
root@starfive:~# curl -L https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.10.4/sha256sum.md
f0a5677f8f6e69f33676a2342684d931854736af1a5fe7766a6a1a60dbfd4094  u-boot-spl.bin.normal.out
bdefd19f7488129a7599df4f5e4ee28ec32fd3b5347ecbbd8e8ec9cb771259f3  visionfive2_fw_payload.img
root@starfive:~# sha256sum u-boot-spl.bin.normal.out
f0a5677f8f6e69f33676a2342684d931854736af1a5fe7766a6a1a60dbfd4094  u-boot-spl.bin.normal.out
root@starfive:~# sha256sum visionfive2_fw_payload.img
bdefd19f7488129a7599df4f5e4ee28ec32fd3b5347ecbbd8e8ec9cb771259f3  visionfive2_fw_payload.img
  1. ok, so updating:
root@starfive:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00001000 "spl"
mtd1: 00300000 00001000 "uboot"
mtd2: 00100000 00001000 "data"
root@starfive:~# flashcp -v u-boot-spl.bin.normal.out /dev/mtd0
Erasing blocks: 32/32 (100%)
Writing data: 127k/127k (100%)
Verifying data: 127k/127k (100%)
root@starfive:~# flashcp -v visionfive2_fw_payload.img  /dev/mtd1
Erasing blocks: 684/684 (100%)
Writing data: 2734k/2734k (100%)
Verifying data: 2734k/2734k (100%)
  1. after this - I just poweroff, unplugged sd card, changed boot priority dip switches and started board from eMMC.

It started successfully :slight_smile:

Here I needed to tweak new installation, because of lack of ssh I needed to do so from UART (probably monitor + keyboard is another option), my steps were:

  1. fix apt:
root@starfive:~# wget -q https://deb.debian.org/debian-ports/pool/main/d/debian-ports-archive-keyring/debian-ports-archive-keyring_2023.02.01_all.deb
root@starfive:~# dpkg -i debian-ports-archive-keyring_2023.02.01_all.deb
root@starfive:~# echo -e "#`cat /etc/apt/sources.list`\ndeb http://ftp.ports.debian.org/debian-ports/ unstable main non-free" > /etc/apt/sources.list
root@starfive:~# apt update && apt upgrade -f && apt autoremove
  1. install needed tools + modify (/etc/ssh/sshd_config) to allow root login
root@starfive:~# apt install openssh-server screen -y

at this stage system is ready, of course I added more things and get rid of several things (like gui, using it headless only).

at the end lsblk look like this:

root@starfive:~# lsblk
[  131.878423] mmc_host mmc0: Bus speed (slot 0) = 198000000Hz (slot req 400000Hz, actual 399193HZ div = 248)
[  132.135122] mmc_host mmc0: Bus speed (slot 0) = 198000000Hz (slot req 100000000Hz, actual 99000000HZ div = 1)
mtdblock0     31:0    0   128K  0 disk
mtdblock1     31:1    0     3M  0 disk
mtdblock2     31:2    0     1M  0 disk
mmcblk0      179:0    0  28.9G  0 disk
├─mmcblk0p1  179:1    0     2M  0 part
├─mmcblk0p2  179:2    0     4M  0 part
├─mmcblk0p3  179:3    0   100M  0 part /boot
└─mmcblk0p4  179:4    0  15.5G  0 part /
mmcblk0boot0 179:8    0     4M  1 disk
mmcblk0boot1 179:16   0     4M  1 disk
nvme0n1      259:0    0 232.9G  0 disk
└─nvme0n1p1  259:1    0 232.9G  0 part

on UART there are many messages about changing frequency of mmc. Also I noticed that it’s running in HS200 mode (my is capable of HS400). so far board hanged two times with some messages about stalled cpu, once I needed to do poweroff.

Everything went smooth on second board.

My impressions about this image:

  1. please share it in future via cli downloadable image, google/baidu needs full browser (or some combination to pass auth cookies)
  2. it’s fresh image and apt is already broken with old key and packages
  3. initial size 2GB is ok to do setup, but system takes 95% so if You forgot to resize then it will not allow to do any update - will run out of space quickly
  4. kernel of course is old, I expected something more decent
  5. lack of sshd is not helping - You need uart or monitor/keyboard to connect for first time,
  6. cli image would be great, now I needed to remove most of packages due to gui, that one could be about 2/3 smaller

I’m getting regular reboots, about every hour or so. I left it up over night and when I checked in the morning it had 48 minutes of uptime. All the reboots I have seen are while the system is at idle.

1 Like

This sound like power or heat problem…
Mine two boards are running stable, even with full load (stress test),
Earlier I already added to to them:

  • large heatsink for SOC and small 40mm blower (when doing stress tests)
  • two small radiators for PMIC and USB controller (based on thermal image)
  • of course some 2.4A usb adapter (non PD)

I would start with checking different power source and applying some cooling, I also assume that Your eMMC is ok :slight_smile:

edit: just checked setup without fan/blower - runs fine for whole day at less than 40 degree.

1 Like

I’m using a PinePower and it does seem now that it might be having an issue. The SanDisk Extreme sdcard is known good and I had already ruled out a thermal problem. I’m running a XU4 heatsink and fan and used a quick script to monitor the VF2 so I knew the temperature was ok.

75, Fri Mar 3 04:28:53 PM EST 2023, 375, 375, 375, 750, 32
76, Fri Mar 3 04:29:53 PM EST 2023, 375, 375, 375, 750, 32
77, Fri Mar 3 04:30:53 PM EST 2023, 375, 375, 375, 750, 32
78, Fri Mar 3 04:31:53 PM EST 2023, 375, 375, 375, 750, 32
79, Fri Mar 3 04:32:53 PM EST 2023, 375, 375, 375, 750, 31
80, Fri Mar 3 04:33:53 PM EST 2023, 375, 375, 375, 750, 32
81, Fri Mar 3 04:34:53 PM EST 2023, 375, 375, 375, 375, 32
82, Fri Mar 3 04:35:53 PM EST 2023, 375, 375, 375, 375, 32

For anyone interested:

echo "C, Date,                   Freq0, Freq1, Freq2, Freq3, Temp"

while true :
     fa=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`
     fb=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq`
     fc=`cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq`
     fd=`cat /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq`
     s1=`cat /sys/devices/platform/soc/120e0000.tmon/hwmon/hwmon0/temp1_input`
     echo $z, $d, $(($fa/1000)), $(($fb/1000)), $(($fc/1000)), $(($fd/1000)), $(($s1/1000))
     sleep 60
     (( z += 1 ))

I’ll try another power supply and hopefully put this to rest. Thanks for confirming you weren’t having any problems.


For good temp/freq monitoring just use sbc-bench
yep - this is same heatsink as mine, running without fan now.