Is this a maybe an nvme card that was previously used in a Unleashed+Microsemi Expansion Board system? In that case, you need to wipe the old unleashed image off the card before you can use it in an unmatched. More generally, I think the rule is that if there is a /boot partition with a extlinux.conf file in it, then u-boot will try to boot from nvme. So just deleting the extlinux.conf file might be enough. If you are handy with u-boot, maybe there is a way to work around this by interrupting autoboot and then manually booting from the sdcard partition?
The factory microSD booted just fine, so the image seem correct…
Then did the magic with nvme:
1 Resize partition and expand the 4th partition to maximum capacity. Where nvmeX is
the NVMe device you want to expand the partition of:
i. sgdisk -v /dev/nvmeX
ii. sgdisk -e /dev/nvmeX
iii. parted /dev/nvmeX resizepart 4 100%
iv. resize2fs /dev/nvmeX
v. sync
2. Modify files on the device to configure U-Boot to use that device for the root file system.
a. Mount the NVMe drive to Linux (or even use Windows machine to access because
the boot partition is a fat file system). It’s the third partition with the “boot” label.
b. Edit extlinux/extlinux.conf file of the boot labeled partition to change the “root=” boot
parameter to the fourth partition of the NVMe device which is the root partition of the
FUSDK build.
Your instructions suggest that you want root on nvme. But it sounds like you put an entire image including u-boot and kernel on the nvme. The boot loader is probably getting confused by this. If all you want on nvme is the root file system, then only copy the root file system to the nvme instead of the entire image. Then modify the sdcard boot partition to use the nvme root. There are example instructions on how to do this here https://github.com/carlosedp/riscv-bringup/tree/master/unmatched
I think that deleting the extlinux.conf file from the nvme drive will make it boot again, but you may need to remove the nvme drive to do that.
Officially, SiFive doesn’t support booting from nvme yet. In theory it should work, but it is hard to get right. Meanwhile, you should only try this if you are willing to debug boot time issues. Or perhaps wait until the distros have support for this. I think the process to make this work is more complicated than what you did. I haven’t tried doing it myself yet. There are some instructions here that talk about doing this for Ubuntu. This suggests that modifying the u-boot config is necessary which you didn’t mention. https://blogjawn.stufftoread.com/install-ubuntu-on-hifive-unmatched.html
I don’t know how to update the u-boot environment. I was just quoting from the ubuntu docs I pointed at. Maybe that is an Ubuntu specific tool?
I forgot about the SW Reference Manual. This is relatively new. I tried the instructions and they worked for me. I then tried a powercycle and now I get the same error that you mentioned two times in a row. I then tried booting from mmc as per the docs, then a powercycle, and it comes up OK booting from nvme. Another try and it came up from nvme again directly without booting from mmc first. There is clearly something wrong here. It is booting from nvme OK only about 50% of the time. As I mentioned before, booting from nvme isn’t fully supported yet, even though it is documented. If you run into a problem, try booting multiple times, and if that doesn’t work, try booting from mmc first, and then powercycling to boot into nvme. Though I don’t know if that is actually helping, maybe that was an accident that it worked for me.
FYI The ubuntu booting from nvme docs mention that there is a race condition that may cause it to accidentally try to boot from mmc. Maybe that is the problem that we are hitting?
This problem will hopefully be fixed as the software work progresses. Progress has been slow so far because only a small number of people had access to the boards. Now that they are shipping things should start improving.