Boot from NVME

The fastboot option makes it possible to create a bootable emmc, but is there also an option to boot from NVME? Or can I just copy the filesystem from SD-card to the NVME, remove te SD-card and then restart?

VisionFive 2 Lite / VisionFive support booting from NVMe, provided that your QSPI bootloader needs to support NVMe. Not required to remove SD card if your U-Boot bootcmd points to NVMe.

you can use this command to set the bootup sequence under the uboot.

setenv boot_devs “nvme mmc” 
saveenv
2 Likes

After you have connected once using a serial cable and saved the default environment to /dev/mtd1 using saveenv then you can update the variables stored in the QSPI flash from an OS:

$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000f0000 00001000 "spl"
mtd1: 00010000 00001000 "uboot-env"
mtd2: 00f00000 00001000 "uboot"
$ sudo apt install libubootenv-tool
$ sudo cat > /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd1               0x0             0x10000         0x1000
^D
$

$ sudo fw_printenv bootcmd
$ sudo fw_printenv boot_targets
$ sudo fw_printenv boot_devs
$ sudo fw_printenv

But of course if you make a bad enough typo using fw_setenv you will need to use a USB to 3.3v TTL serial cable to fix up the variables in your Das U-Boot environment.

1 Like

I have installed the nvme in the M.2 M key, but I see nothing in lsblk.

Is this the problem of the wrong QSPI bootloader? And how do I install the right one (in a visionfive 2 lite board)?

Make sure your USB power supply is providing enough power. I have two different power supplies, with the one, I can see (lspci) and use (hdparm/dd) the NVMe, with the other, I can see the drive (lspci) but can’t access it with some strange error (can’t remember, something about drive not having any actual storage capacity).

1 Like

1、The power adapter is greater than 5V3A.
2、Replace the NVME with a different brand and model.

1 Like

I replaced the NVME and then I could see the device and I could copy /dev/sda to /dev/nvme0n1.

But after setting the boot_devs to “nvme mmc” I got the following respons:

StarFive # setenv boot_devs “nvme mmc”
StarFive # saveenv
Saving Environment to SPIFlash… Erasing SPI flash…Writing to SPI flash…done
OK
StarFive # boot
starfive_pcie pcie@2C000000: Port link up.
starfive_pcie pcie@2C000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10

Device 0: Vendor: 0x144d Rev: 7L1QFXM7 Prod: S65ENX0T235204
Type: Hard Disk
Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
… is now current device
Try booting from NVME0 …

Device 0: Vendor: 0x144d Rev: 7L1QFXM7 Prod: S65ENX0T235204
Type: Hard Disk
Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
… is now current device
Try booting from NVME0 …
MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
Try booting from MMC0 …
Tring booting distro …

Device 0: Vendor: 0x144d Rev: 7L1QFXM7 Prod: S65ENX0T235204
Type: Hard Disk
Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
… is now current device
Try booting from NVME0 …
419 bytes read in 1 ms (409.2 KiB/s)
Retrieving file: /extlinux/extlinux.conf
806 bytes read in 1 ms (787.1 KiB/s)
U-Boot menu
1: Ubuntu 24.04.3 LTS 6.12.5-starfive
2: Ubuntu 24.04.3 LTS 6.12.5-starfive (rescue target)
Enter choice: 1
1: Ubuntu 24.04.3 LTS 6.12.5-starfive
Retrieving file: /initrd.img-6.12.5-starfive
Unhandled exception: Load access fault
EPC: 00000000f7f2beb2 RA: 00000000f7f2bb0a TVAL: ffffffbd2f0ded05
EPC: 000000004022eeb2 RA: 000000004022eb0a reloc adjusted

SP: 00000000f76dd560 GP: 00000000f76ecdd0 TP: 0000000000000001
T0: 00000000f771a080 T1: 57c7473d2f0ded05 T2: 0000b9f00000b9ef
S0: 00000000f76fd0d0 S1: 0000000000000001 A0: 00000000f76dd6c0
A1: 0000000000000000 A2: ffffffffd0362cd6 A3: 0000000000000001
A4: 0000000000000200 A5: 00000000f770b1f0 A6: 57c7473d2f0ded05
A7: 0000000000010468 S2: 0000000000010468 S3: 00000000f76fd030
S4: 00000000f76dd6c0 S5: 00000000f7fcdec0 S6: 00000000f7723200
S7: 000000000ffffff0 S8: 000000000000fff0 S9: 0000000000000ff0
S10: 0000000000c2fa00 S11: 0000000000000020 T3: 00000000f7fcd950
T4: 000000000000000a T5: 00000000f7fcd950 T6: 0000000000010469

Code: 8eaa 853e 3783 000e 88b2 8f72 833e 881a (3303 0003)

resetting …

U-Boot SPL 2021.10 (Sep 15 2025 - 16:03:04 +0800)
LPDDR4: 8G version: g8ad50857.
Trying to boot from SPI

OpenSBI v1.2

What did I wrong?

What kind of nvme did you use?

maybe it is compatibility problems.

I tried Zhiti Kingston Netac and WD, all of them is ok; but KIOXIA can not boot up.

And i use command is

time dd if=ubuntu-24.03-preinstalled-desktop-riscv64-vf2-lite.img  of=/dev/nvm
e0n1 bs=4M conv=fsync