Orange Pi 5 - Boot from NVME

Sorry for confusion!

I have booted Orange Pi Debian image, Ran the tool to set SPI to boot from NVME.

Now i used DD command to write Diet pi image to NVME but it doesnt boot ?

You need to update the bootloader and not just set the option to boot from NVMe

Thanks all!

Managed to wipe all partions from the SPI and reinstall bootloader.

Booting from NVME alone into dietpi now

1 Like

Awesome…will this auto update the uboot if/when kernel is upgraded?

Very very awesome…I hope to be able to get my Orange Pi PC done this way…I know it only runs under USB 2.0…but has to be SO much faster than a stupid SD card…even a class 10 one.

Better to use a NVMe instaed of USB connected device :wink:

1 Like

And care for the right M.2 card (nVME card).

1 Like

I think for now we’ll just add the option to dietpi-config to manually update/flash U-Boot to the root device and/or SPI. As long as the board boots, there is usually no reason to update the bootloader, as this is its only task. Flashing U-Boot without specific reason (like enabling booting from other devices) on a perfectly functioning device is also a risk, especially with the Armbian U-Boot packages. It happened quite a few times that a new U-Boot build suddenly broke boot. Also Armbian does not automatically flash U-Boot when the package is updated, for the same reason I suppose.

Is there any way to create a script that will put the uboot and image stuff on the SD and have it point to the root partition on the NVME/USB device…this way allowing the SBC’s that don’t have flashable EEPROMS to allow for booting to USB/NVME to be able to have the SD card be the boot device, but have the external faster device be the root device?

The Orange Pi 5 can boot from NVMe fully. There is no need for a SD card at all. It’s already quite fast booting in 5 seconds.

Startup finished in 3.292s (kernel) + 2.211s (userspace) = 5.503s.

I understand this…I am referring to other devices that may not have that ability

I had this “feature” before I updated my Opi5’s bootloader:

  1. Installed my system on a SD card
  2. Copied my whole SD card via dd to the NVMe card (e.g. dd if=/dev/mmcblk0 of=/dev/nvme0n1 bs=1M status=progress)
  3. Rebooted

That led to a state, where the UUIDs, PTUUID, etc. of the SD card and the NVMe were identical.
The system booted from the SD card and mounted the root filesystem from the NVMe. :slight_smile:

But I am not sure whether this is a recommendable solution.

Ultimate solution is this: USB boot | Provide tiny SD card image as USB boot relay · Issue #6186 · MichaIng/DietPi · GitHub
I’ll most likely not have time for this until v8.16, but it has higher priority to me and is generally independent of DietPi releases (no change required to DietPi, just an additional set of bootloader-only images).

I just tried the new option in 8.16 -> dietpi-config -> Advanced Options menu to update the SPI flash bootloader.

It did not work. It was previously booting from NVMe with the solution below:

. /usr/lib/u-boot/
write_uboot_platform_mtd "$DIR" /dev/mtdblock0

When I used the new option in dietpi-config menu to update the SPI flash bootloader, NVMe stopped booting. I had to flash and boot from an SD to run the and write_uboot_platform_mtd to make NVMe to boot again.

Am I doing something wrong? Or is the new option in dietpi-config not working as expected?

ping @MichaIng can you have a look pls

1 Like

Can you test again whether the system comes up after a reboot? We just tested it and it seems that this bootloader has issues with reboot but requires a power cycle to come up again. The dietpi-config update and write_uboot_platform_mtd however (should) do exactly the same: The only difference is that we make the dd output visible.

Probably we should find a source for and download the one from Orange Pi themselves instead of flashing the one from Armbian :thinking:.

1 Like

Thanks. I just tested again. Indeed dietpi-config update and write_uboot_platform_mtd do the same thing. Some observations below:

  1. Reboot in fact does not boot back from NVMe.
  2. A power cycle did not work initially. I took three tentatives to achieve a successful boot from NVMe.
  3. In a second test, it took 5 power cycles for the NVMe boot to work.

if possible, flash the Orange Pi Debian image on a spare SD card and update firmware + SPI using Orange Pi config tool. This way you should get regular reboot functionality back.

1 Like

Coincidently I had just done this before reading your post! (but used Orange Pi Ubuntu Jammy Server image instead of Debian).

After manually erasing SPI and flashing it via orangepi-config from Orange Pi Ubuntu Server image, now dietpi is booting normally from NVMe (also reboot is working now).


ok probably the U-Boot from Armbian we use is not working well. We need to have a look.

1 Like

Armbian uses the Radxa U-Boot sources for all RK3588 SBCs, which may be the problem: build/rockchip-rk3588.conf at 40fa40ebaaa9d450033e6a1c7394028448dae2ee · armbian/build · GitHub
Orange Pi have their own sources which are also used by their own build scripts (which are an Armbian fork): GitHub - orangepi-xunlong/u-boot-orangepi

Since I’m not keen to compile it myself yet, checking for compiled binaries. But their website is currently down. Uff, and why is it all plain HTTP (no encryption, no authentication) :thinking:.