DietPi for VisionFive2 not booting

Hi everyone
So I wanted to run DietPi on my VisionFive2.
I downloaded the image from Index of /downloads/images/testing
and flashed the image on an SD card. (tried both with rufus and balena etcher)
The VisionFive2 green led doesnt blink and there is no HDMI output.

uboot version is: “U-Boot 2021.10 (Feb 28 2023 - 21:44:53 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-31”

The serial output says:

switch to partitions #0, OK
mmc1 is current device
found device 1
bootmode flash device 1
** Invalid partition 3 **
Couldn't find partition mmc 1:3
Can't set block device
** Invalid partition 3 **
Couldn't find partition mmc 1:3
Can't set block device
Hit any key to stop autoboot:  2  1  0 
** Invalid partition 3 **
Couldn't find partition mmc 1:3
Can't set block device
Importing environment from mmc1 ...
## Info: input data size = 15974 = 0x3E66
** Invalid partition 3 **
Couldn't find partition mmc 1:3
Can't set block device
## Warning: defaulting to text format
## Error: "boot2" not defined
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
258 bytes read in 7 ms (35.2 KiB/s)
1:	DietPi
Retrieving file: /boot/vmlinuz-6.1.90
24873984 bytes read in 1043 ms (22.7 MiB/s)
append: root=PARTUUID=(hiding this value just to be sure) rootfstype=ext4 rootwait earlycon=sbi console=ttyS0,115200 console=tty1 consoleblank=0 net.ifnames=0
Retrieving file: /usr/lib/linux-image-visionfive2/starfive/jh7110-starfive-visionfive-2-v1.3.dtb
Failed to load '/usr/lib/linux-image-visionfive2/starfive/jh7110-starfive-visionfive-2-v1.3.dtb'
Skipping DietPi for failure retrieving FDT
SCRIPT FAILED: continuing...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
e7e[re[999;999He[6ne8Card did not respond to voltage select! : -110
No EFI system partition
ethernet@16030000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16030000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110StarFive #

There seems to be various errors of different type. Can someone help?

Thank you very much!

My VF2 runs with U-Boot 2021.10 (Sep 26 2023 - 22:53:52 +0800), Build: jenkins-github_visionfive2-18. I don’t know what is the difference to your uboot version.

I am booting from a NVMe card:

Device 0: Vendor: 0x144d Rev: 15302029 Prod:       S4GVNF0MA54150
            Type: Hard Disk
            Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
... is now current device
Scanning nvme 0:1 ...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
260 bytes read in 4 ms (63.5 KiB/s)
1:      DietPi
Retrieving file: /boot/vmlinuz-6.1.92
24873984 bytes read in 130 ms (182.5 MiB/s)
append: root=PARTUUID=ada6cebb-01 rootfstype=ext4 rootwait earlycon=sbi console=ttyS0,115200 console=tty1 consoleblank=0 net.ifnames=0
Retrieving file: /usr/lib/linux-image-visionfive2/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
49081 bytes read in 6 ms (7.8 MiB/s)
## Flattened Device Tree blob at 46000000
   Booting using the fdt blob at 0x46000000
   Using Device Tree in place at 0000000046000000, end 000000004600efb8

Starting kernel ...
...

A quick test with the latest image downloadable from DietPi gives the identical u-boot as before (jenkins-github_visionfive2-18) and also fails to boot from the SD card:

Device 0: unknown device
Trying to boot from mmc1 ...
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1 ...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
258 bytes read in 8 ms (31.3 KiB/s)
1:      DietPi
Retrieving file: /boot/vmlinuz-6.1.90
24873984 bytes read in 1071 ms (22.1 MiB/s)
append: root=PARTUUID=8e337bee-01 rootfstype=ext4 rootwait earlycon=sbi console=ttyS0,115200 console=tty1 consoleblank=0 net.ifnames=0
Retrieving file: /usr/lib/linux-image-visionfive2/starfive/jh7110-starfive-visionfive-2-v1.3.dtb
Failed to load '/usr/lib/linux-image-visionfive2/starfive/jh7110-starfive-visionfive-2-v1.3.dtb'
Skipping DietPi for failure retrieving FDT
SCRIPT FAILED: continuing ...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Card did not respond to voltage select! : -110
No EFI system partition
** Invalid partition 3 **
Couldn't find partition mmc 1:3
Trying to boot from usb0 ...
resetting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
Trying to boot from mmc0 ...
Card did not respond to voltage select! : -110
Trying to boot from dhcp ...
ethernet@16030000 Waiting for PHY auto negotiation to complete....... done
BOOTP broadcast 1
DHCP client bound to address 192.168.178.57 (4 ms)
Using ethernet@16030000 device
TFTP from server 192.168.178.1; our IP address is 192.168.178.57
Filename 'boot.scr.uimg'.
Load address: 0x43900000
Loading: *
TFTP server died; starting again
BOOTP broadcast 1
DHCP client bound to address 192.168.178.57 (92 ms)
Using ethernet@16030000 device
TFTP from server 192.168.178.1; our IP address is 192.168.178.57
Filename 'boot.scr.uimg'.
Load address: 0x40200000
Loading: *
TFTP server died; starting again
StarFive #
...

@MichaIng: The dtb file load fails. Were there any changes?
On my NVMe card, the file jh7110-starfive-visionfive-2-v1.3b.dtb is present in /usr/lib/linux-image-visionfive2/starfive, also on the SD card (which I did mount on the VF2 to explore the files). Also all 4 .dtb files within the directory are identical (tested with cmp command).

For testing I changed the order in the extlinux.conf file (load dtb file after append root) but this did not help to boot from SD card.
Can it be that the / file system is not ready when appending it via extlinux.conf?

Looks like I forgot to update the device tree name somewhere for fresh installs, which did work well for updates. StarFive recently aligned it with mainline Linux.

I’ll have a look and build a new image ASAP. Not more than a typo or missing path change.

EDIT: Ah, probably it is just v1.3.deb vs v1 3b.dtb, i.e. the “b” missing in /boot/dietpiEnv.txt.

Yessss! You are right, I did oversee the typo within extlinux.conf (not dietpiEnv.txt, this is not present in the VF2 image).
I changed the line in /boot/extlinux/extlinux.conf from
fdt /usr/lib/linux-image-visionfive2/starfive/jh7110-starfive-visionfive-2-v1.3.dtb
to
fdt /usr/lib/linux-image-visionfive2/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
and off we go…
All is working now with the SD card.

Remark: I think I had to do a manual power cycle after the firstboot of the system (the reboot took very long, so I power cycled the board and then the rest of the firstboot installation went on).

1 Like

@mauromarz: Thanks for the good preparation of the bug, especially your UART output helped a lot. :ok_hand:

For a quick solution you could also mount your SD card on a different system and edit the extlinux.conf like I described above.

Indeed, I forgot the “b” in the default /boot/extlinux/extlinux.conf. At least on update, it is migrated correctly. Would have been worse if an update broke boot :sweat_smile:.

Fixed: deb: fix device tree name in default extlinux.conf · MichaIng/linux@8b9aee2 · GitHub
Build is running: deb: fix device tree name in default extlinux.conf · MichaIng/linux@8b9aee2 · GitHub
Adding it to APT repo and rebuild image once this has finished.

And yes, many thank for reporting! Indeed I also needed to look through it some more times to recognise this little difference.

New image is in place with fixed device tree name.

And the new image works. :slight_smile: :+1:

1 Like