SOURCE: https://github.com/MathiasStadler/orange-pi-zero-boot-from-spi
I spent the whole day trying to boot without a microSD, and I finally got it, using the Orange Pi Zero SPI boot tutorial, with a few adjustments.
First of all, you’ll need a microSD card. I used this Armbian version Armbian_24.11.1_Orangepizero2_noble_current_6.6.62_minimal.img.xz
Once the system has booted from the microSD:
sudo apt update && sudo apt upgrade -y
reboot
After the system reboots, we need to check if the SPI flash is detected:
cat /proc/mtd
#It should return something like:
dev: size erasesize name
mtd0: 00200000 00001000 "spi0.0"
#Double-check with:
ls -l /dev/mtd*
#You should get something like:
crw------- 1 root root 90, 0 Apr 10 19:34 /dev/mtd0
crw------- 1 root root 90, 1 Apr 10 19:34 /dev/mtd0ro
brw-rw---- 1 root disk 31, 0 Apr 10 19:34 /dev/mtdblock0
/dev/mtd/
total 0
drwxr-xr-x 2 root root 60 Apr 10 19:34 by-name
If you see a device at /dev/mtd0 or /dev/mtd/by-name/spi0.0, you can flash U-Boot to the SPI.
# Create an empty image
sudo dd if=/dev/zero count=2048 bs=1K | tr '\000' '\377' > spi.img
# Write U-Boot to the image
sudo dd if=/usr/lib/linux-u-boot-current-orangepizero2/u-boot-sunxi-with-spl.bin of=spi.img bs=1k conv=notrunc
# Flash the image to SPI
sudo flashcp -v spi.img /dev/mtd0
# Or /dev/mtd/by-name/spi0.0
Now it's time to plug in the USB drive (SSD or flash drive):
# Install Armbian to the USB stick, pendrive or SSD
# Follow the instructions in the menu, default values are usually fine
# DON'T REBOOT the device after this step
sudo nand-sata-install
# Mount the USB stick
sudo mount /dev/sda1 /mnt
# Copy (overwrite) the /boot directory
sudo cp -a /boot /mnt
# Now edit /mnt/boot/boot.cmd and set the correct root device:
setenv rootdev "/dev/sda1"
#Then generate the new boot.scr
sudo mkimage -C none -A arm -T script -d /mnt/boot/boot.cmd /mnt/boot/boot.scr
#Finally, edit armbianEnv.txt to update the rootdev by UUID:
blkid /dev/sda1
#Copy the UUID and update this line rootdev=UUID=your-usb-uuid
nano /mnt/boot/armbianEnv.txt
Now the moment of truth:
sudo shutdown -Fh now
Disconnect power and remove the microSD card.
Reconnect the power adapter and the system should boot from the USB drive.
If there's no sign of life, it's highly recommended to use a UART adapter to debug. Some boards require a jumper between GPIO pins 13 and 14 to boot from SPI — on my board (V1.5), this was not necessary.