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