NVME not functioning

Hey,

With the nvme (Samsung 970 EVO Plus 1 TB) inserted I’m getting this:

Model: SiFive HiFive Unmatched A00
Net:   eth0: ethernet@10090000
Hit any key to stop autoboot:  0 
PCIe Link up, Gen1

Device 0: Vendor: 0xUnhandled exception: Illegal instruction
EPC: 0000000000000000 RA: 0000000000000000 TVAL: 0000000000000000
EPC: ffffffff8029d000 RA: ffffffff8029d000 reloc adjusted


resetting ...
System reset not supported on this platform
### ERROR ### Please RESET the board ###

Any thoughts?

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?

1 Like

I’m seeing this too with: 2021.05.00

U-Boot SPL 2021.01 (May 31 2021 - 07:12:33 +0000)
Trying to boot from MMC1

U-Boot 2021.01 (May 31 2021 - 07:12:33 +0000)

CPU:   rv64imafdc
Model: SiFive HiFive Unmatched A00
DRAM:  16 GiB
MMC:   spi@10050000:mmc@0: 0
EEPROM: SiFive PCB EEPROM format v1
Serial number: SF105SZ211900195
PCB revision: 3
Ethernet MAC address: 70:b3:d5:92:f5:38
CRC: 70d9989d
EEPROM dump: (0x25 bytes)
00: F1 5E 50 45 01 02 00 03 42 00 53 46 31 30 35 53 
10: 5A 32 31 31 39 30 30 31 39 35 01 70 B3 D5 92 F5 
20: 38 9D 98 D9 70 
found SiFive v1
In:    serial@10010000
Out:   serial@10010000
Err:   serial@10010000
Model: SiFive HiFive Unmatched A00
Net:   eth0: ethernet@10090000
Hit any key to stop autoboot:  0 
PCIe Link up, Gen1

Device 0: Vendor: 0x144d Rev: 2Unhandled exception: Illegal instruction
EPC: 0000000000000000 RA: 0000000000000000 TVAL: 0000000000000000
EPC: ffffffff8029d000 RA: ffffffff8029d000 reloc adjusted


resetting ...
System reset not supported on this platform
### ERROR ### Please RESET the board ###
������

Brand new board from Crowd supply, i used Etcher to write *.wic to both the factory microSD and the nvme:

factory microSD: demo-coreip-cli-unmatched-2021.05.00.rootfs.wic.xz

nvme (Samsung 970 EVO Plus 1 TB) : demo-coreip-cli-unmatched-2021.05.00.rootfs.wic.xz

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.

Regards,

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

1 Like

Just an observation. With the Ubuntu scheme of using NVME, there are boot loader partitions on the NVME.

ubuntu@riscv64:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  29.7G  0 disk 
├─mmcblk0p1  179:1    0   3.4G  0 part 
├─mmcblk0p12 259:0    0     4M  0 part 
├─mmcblk0p13 259:1    0     1M  0 part 
├─mmcblk0p14 259:2    0     4M  0 part 
└─mmcblk0p15 259:3    0   106M  0 part /boot/efi
nvme0n1      259:4    0 465.8G  0 disk 
├─nvme0n1p1  259:5    0 465.6G  0 part /
├─nvme0n1p12 259:6    0     4M  0 part 
├─nvme0n1p13 259:7    0     1M  0 part 
├─nvme0n1p14 259:8    0     4M  0 part 
└─nvme0n1p15 259:9    0   106M  0 part 
ubuntu@riscv64:~$

Hi @jimw on my first pass i was using the directions from SiFive:

HiFive Unmatched SW Reference Manual

Section 2.7: Boot Options including NVMe

Other then modifying extlinux/extlinux.conf, those directions assume booting from microSD with the nvme pretty much the same “image/data”…

Regards,

With the nvme blanked out and just simple ext4 partition:

U-Boot SPL 2021.01 (May 31 2021 - 07:12:33 +0000)
Trying to boot from MMC1


U-Boot 2021.01 (May 31 2021 - 07:12:33 +0000)

CPU:   rv64imafdc
Model: SiFive HiFive Unmatched A00
DRAM:  16 GiB
MMC:   spi@10050000:mmc@0: 0
EEPROM: SiFive PCB EEPROM format v1
Serial number: SF105SZ211900195
PCB revision: 3
Ethernet MAC address: 70:b3:d5:92:f5:38
CRC: 70d9989d
EEPROM dump: (0x25 bytes)
00: F1 5E 50 45 01 02 00 03 42 00 53 46 31 30 35 53 
10: 5A 32 31 31 39 30 30 31 39 35 01 70 B3 D5 92 F5 
20: 38 9D 98 D9 70 
found SiFive v1
In:    serial@10010000
Out:   serial@10010000
Err:   serial@10010000
Model: SiFive HiFive Unmatched A00
Net:   eth0: ethernet@10090000
Hit any key to stop autoboot:  0 
PCIe Link up, Gen1

Device 0: Vendor: 0x144d Rev: 2Unhandled exception: Illegal instruction
EPC: 0000000000000000 RA: 0000000000000000 TVAL: 0000000000000000
EPC: ffffffff8029d000 RA: ffffffff8029d000 reloc adjusted


resetting ...
System reset not supported on this platform
### ERROR ### Please RESET the board ###

How does one “update” boot_targets? saveenv doesn’t seem to exist, i bypassed nvme0 usage in boot_targets

boot_targets=nvme0 usb0 mmc0 pxe dhcp
boot_targets=mmc0
boot

NVME drive comes up fine once booted…

root@unmatched:~# uname -r
5.12.4
root@unmatched:~# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mtdblock0    31:0    0    32M  0 disk 
mmcblk0     179:0    0  29.7G  0 disk 
|-mmcblk0p1 179:1    0     1M  0 part 
|-mmcblk0p2 179:2    0     4M  0 part 
|-mmcblk0p3 179:3    0   130M  0 part /boot
`-mmcblk0p4 179:4    0   6.5G  0 part /
nvme0n1     259:0    0 931.5G  0 disk 
`-nvme0n1p1 259:1    0 931.5G  0 part /run/media/nvme0n1p1
root@unmatched:~# dmesg | grep nvme
[    3.080378] nvme nvme0: pci function 0000:06:00.0
[    3.084409] nvme 0000:06:00.0: enabling device (0000 -> 0002)
[    3.097204] nvme nvme0: missing or invalid SUBNQN field.
[    3.102407] nvme nvme0: Shutdown timeout set to 8 seconds
[    3.129416] nvme nvme0: 4/0/0 default/read/poll queues
[    3.165707]  nvme0n1: p1
[   23.029231] EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.

lspci
06:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983

Regards,

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.

4 Likes

Fixed for me as of:

Regards,

Is there a backup or entry on this site (maybe github) for the instructions provided at the link:

https://blogjawn.stufftoread.com/install-ubuntu-on-hifive-unmatched.html

The site is no longer available.

Much appreciated!

One fallback backup is always the Wayback Machine:

ah right! thanks - always forget that resource is available.