# NVME not functioning

**URL:** <https://forums.sifive.com/t/nvme-not-functioning/4762>\
**Category:** HiFive Unmatched\
**Created:** [June 7, 2021, 2:45pm UTC](https://forums.sifive.com/t/nvme-not-functioning/4762 "2021-06-07T14:45:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamescorbett](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jamescorbett](https://forums.sifive.com/u/jamescorbett)\
**Post date:** [June 7, 2021, 2:45pm UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/1 "2021-06-07T14:45:45Z")

</div>

Hey,

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![jimw](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jimw](https://forums.sifive.com/u/jimw)\
**Post date:** [June 7, 2021, 3:23pm UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/2 "2021-06-07T15:23:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@RobertCNelson](https://forums.sifive.com/u/RobertCNelson)\
**Post date:** [June 10, 2021, 11:20pm UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/3 "2021-06-10T23:20:13Z")

</div>

I’m seeing this too with: 2021.05.00

```auto
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](https://github.com/sifive/freedom-u-sdk/releases/download/2021.05.00/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](https://github.com/sifive/freedom-u-sdk/releases/download/2021.05.00/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:

```auto
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,

---

<div class="post-metadata">

**Author:** ![jimw](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jimw](https://forums.sifive.com/u/jimw)\
**Post date:** [June 11, 2021, 1:03am UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/4 "2021-06-11T01:03:53Z")

</div>

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](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](https://blogjawn.stufftoread.com/install-ubuntu-on-hifive-unmatched.html)

---

<div class="post-metadata">

**Author:** ![drmpeg](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/drmpeg/32/1301_2.png) [@drmpeg](https://forums.sifive.com/u/drmpeg)\
**Post date:** [June 11, 2021, 1:29am UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/5 "2021-06-11T01:29:06Z")

</div>

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

```auto
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:~$

```

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@RobertCNelson](https://forums.sifive.com/u/RobertCNelson)\
**Post date:** [June 11, 2021, 2:02am UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/6 "2021-06-11T02:02:01Z")

</div>

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

> **[SiFive](https://www.sifive.com/boards/hifive-unmatched)**
>
> SiFive is the first fabless semiconductor company to build customized silicon based on the free and open RISC-V instruction set architecture.

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,

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@RobertCNelson](https://forums.sifive.com/u/RobertCNelson)\
**Post date:** [June 11, 2021, 3:25pm UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/7 "2021-06-11T15:25:11Z")

</div>

With the nvme blanked out and just simple ext4 partition:

```auto
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

```auto
boot_targets=nvme0 usb0 mmc0 pxe dhcp
boot_targets=mmc0
boot

```

NVME drive comes up fine once booted…

```auto
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,

---

<div class="post-metadata">

**Author:** ![jimw](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jimw](https://forums.sifive.com/u/jimw)\
**Post date:** [June 12, 2021, 4:13am UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/8 "2021-06-12T04:13:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@RobertCNelson](https://forums.sifive.com/u/RobertCNelson)\
**Post date:** [July 31, 2021, 9:29pm UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/9 "2021-07-31T21:29:40Z")

</div>

Fixed for me as of:

> **[Release 2021.07.00 · sifive/meta-sifive](https://github.com/sifive/meta-sifive/releases/tag/2021.07.00)**
>
> This release includes major changes compared previous Freedom U SDK (FUSDK). The main changes include:
> 
> Layers (openembedded-core, meta-openemedded, meta-riscv, meta-clang, meta-tensorflow-lite) w...

Regards,

---

<div class="post-metadata">

**Author:** ![ct.clmsn](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@ct.clmsn](https://forums.sifive.com/u/ct.clmsn)\
**Post date:** [February 1, 2024, 10:51pm UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/10 "2024-02-01T22:51:59Z")

</div>

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](https://blogjawn.stufftoread.com/install-ubuntu-on-hifive-unmatched.html)

The site is no longer available.

Much appreciated!

---

<div class="post-metadata">

**Author:** ![tgm](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tgm](https://forums.sifive.com/u/tgm)\
**Post date:** [February 8, 2024, 9:54am UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/11 "2024-02-08T09:54:07Z")

</div>

One fallback backup is always the Wayback Machine:

- [Wayback Machine](https://web.archive.org/web/20210701000000*/https://blogjawn.stufftoread.com/install-ubuntu-on-hifive-unmatched.html)

---

<div class="post-metadata">

**Author:** ![ct.clmsn](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@ct.clmsn](https://forums.sifive.com/u/ct.clmsn)\
**Post date:** [February 8, 2024, 2:53pm UTC](https://forums.sifive.com/t/nvme-not-functioning/4762/12 "2024-02-08T14:53:59Z")

</div>

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