Orange Pi Zero 2W 1,5GB Boot procedure

For a new project, due to the unavailability of a Pi Zero 2W and the currently rather high prices of other Raspberry Pi models, I decided on an Orange Pi Zero 2W 1.5GB. I don’t have it yet, but it’s on its way. Compatibility with my favorite OS—DietPi—was important to me when making this choice. That’s definitely a given.

Since I struggled with two Banana Pis and a Nano Pi years ago and later came to appreciate the simplicity of the Raspberry Pi, I want to give it another try with a different model due to the issues mentioned above.

Long story short, there are really only 1–2 questions right now:

Can I boot the Orange Pi Zero 2W under DietPi from a storage medium other than an SD card? I was thinking of either a USB flash drive or a USB SSD.

But I just noticed that this Orange Pi doesn’t have USB 3.0 at all, which severely limits the performance of a flash drive or SSD. So, one could certainly argue about the practicality of my plan.

Still, here’s the question again: Do other storage devices work when booting with DietPi, or are a few “workarounds” needed to set that up?

When you move the bootloader to SPI, you could boot from there, but keep your system partition on USB, the u-boot bootloader supports that and this is a quite common scenario.

In theory u-boot also supports booting via PXE, and at least people succeeded to boot the OPi Zero this way: https://www.youtube.com/watch?v=-5FghgwySow

Thanks for the info.
I’ll have a look at the video.
Once the Orange Pi Zero 2W arrives and I’ve managed to get it working, I’ll post an update here on whether it was a success or a failure.
Until then, thanks again!

Hmm, the board indeed has a 16 MiB SPI flash, but AFAIK our U-Boot package does not ship a binary for it. If @Totof do you know whether flashing to SPI is possible via dietpi-software Advanced Options? I am currently on a trip and cannot check.

If not, you would rely on the preflashed bootloader, and I am not sure whether it supports our mainline kernel build and boot script. At least we do define the fdtfile explicitly, so that would be picked correctly.

Hi @MichaIng and @Falconcrest

In dietpi-config, you can update the U-Boot for the SD card.

Update MMC bootloader: Flash current U-Boot to /dev/mmcblk0

The technical documentation for the Zero 2 W board states the following:

2.6. Instructions for using micro-linux system in onboard SPI
Flash
There is a 16MB SPI Flash on the development board, and its location is shown in
the figure below:
A micro Linux system is programmed into SPI Flash by default. This system is
mainly used to prove that the development board can start normally. After getting the
development board, there is no need to burn the system into the TF card. You only need
to connect the Type-C power supply to the development board to start the micro Linux
system in the SPI Flash. The main functions of this system are:
a) After booting into the kernel, the green LED light will flash;
b) If the development board is connected to an HDMI screen, after the system
www.orangepi.cn
30
www.xunlong.tvrange Pi User Manual
Copyright reserved by Shenzhen Xunlong Software Co., Ltd
startup is completed, the command line interface of the micro Linux system can be
seen on the HDMI screen.
I would like to emphasize again that the micro Linux system in SPI Flash is only
used to prove that the development board can start normally (you can light up the
development board without burning the system). If you find that there are other
problems with the system in SPI Flash (such as serial port Unable to log in), please
ignore it.
If you want to use the development board normally, please burn Ubuntu, Debian and
other Linux images or Android images to the TF card, and then use it.

So, an SD card is required.

However, with Samba, you can easily read a remote hard drive, or using the expansion board and connect an external hard drive via USB 2.0.

Wow, thanks to everyone for all the information.
I’ll have to see what’s possible once I’ve got my hands on the Orange Pi Zero 2.
Ultimately, it would be fine if the SD card remained the system drive.
After all, I only use a USB stick or USB SSD with the RPi 4 anyway.
I just wanted to explore what’s possible.
But your information will certainly be invaluable when I’m testing it.

In any case, worth to just try whether it boots from USB as well. I’ll have a look into the device tree, mainline and vendor, whether the SPI storage can be made accessible.

The Zero 3 is supposed to have an SPI flash as well, hence same thing I can check on my own board.

Right, I’ll give it a go then and let you know how it goes.

Good evening, @MichaIng and @Falconcrest
I removed my SD card, kept my USB keyboard and HDMI monitor connected, and powered on my Orange Pi Zero 2W. Here is what appears on the screen:

: bootdevice is "/dev/mtdblock4" , GPT_SUPPORT=1
: Try to load Nor...
: mounting /dev/mtdblock4 on /mnt failed: No such file or directory
: Failed to mount /dev/mtdblock4!

So it seems there is something on the SPI, but not enough to loop though attached boot media.

So, the Orange Pi 2W with the expansion board has now arrived, and the latest DietPi image has been working satisfactorily so far.
The OS runs from the SD card.
As I’ve already mentioned, due to the lack of USB 3.0 ports, there’s little point in connecting a USB SSD.
The internal storage is too small to run the system from there.
So it’s fine as it is.
I just need to think about what I can actually do with it. :grin:
All the best, and many thanks for the support here on the forum.

Yeah that is an SPI storage to hold a bootloader only, not an eMMC for an actual Linux distro. The really interesting question is whether it is possible to access this device from a mainline Llinux system as /dev/mtd0 or /dev/mtdblock0, or whether mainline Linux does not expose it.

Even with USB 2.0 only, USB devices often still have a longer durability than SD cards. Even the flexibility only to boot from either or, is a neat little benefit.

Well, I’ve finally decided to try using a USB SSD as the storage medium. I’ve ordered the parts. Admittedly—after a few commands, ChatGPT says the OrangePi Zero 2W has the following boot order: FEL - mmc0 (SD) - usb0 (USB) - PXE - DHCP.
Well, we’ll see! I’m going to create a clone of the SD card on a Pi 5, write that clone to the USB SSD, and if it works, I’ll finish up by resizing the partition in Drive Manager. The SD card has 32GB and the mSATA SSD has 64GB. I took a slightly more conservative approach with the storage size. Whether it works or not, I’ll let you know.

The boot order depends on the SPI bootloader, if present, and whether it is used at all. Usually, the SD card is searched for a bootloader first by the hardware, and the SPI next. Yeah, let’s see.

And did you check whether /dev/mtd0 and/or /dev/mtdblock0 do exist?

root@orangepi-zero2w:~# echo "=== MTD devices ==="
=== MTD devices ===
root@orangepi-zero2w:~# ls -l /dev/mtd0 /dev/mtdblock0 2>&1
crw------- 1 root root 90, 0 16. Sep 18:16 /dev/mtd0
brw-rw---- 1 root disk 31, 0 16. Sep 18:16 /dev/mtdblock0
root@orangepi-zero2w:~# echo

root@orangepi-zero2w:~# echo "=== MTD partitions ==="
=== MTD partitions ===
root@orangepi-zero2w:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01000000 00001000 "spi0.0"

So far so great. Our U-Boot package does not provide an SPI image. Maybe I can figure out how to create one from the regular/MMC one.

But maybe USB boot works already with whatever Xunlong pre-flashes the SPI storage with.

Good evening @MichaIng & @Falconcrest

I tried cloning my 4GB SD card onto a 4GB USB drive, but the Zero 2W won’t boot—see the screenshot I posted earlier showing the output.

: bootdevice is "/dev/mtdblock4" , GPT_SUPPORT=1
: Try to load Nor...
: mounting /dev/mtdblock4 on /mnt failed: No such file or directory
: Failed to mount /dev/mtdblock4!

I get the same message with or without the USB drive
…without the SD card, of course.

Okay, so looks like we need to flash proper U-Boot for this to work. It looks like it tries to mount another SPI/MTD device that does not exist, or /mnt does not exist, not sure, but it does not even attempt to check for/mount a USB drive.