ricaoalberto Posted April 11 Posted April 11 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. 0 Quote
laibsch Posted April 13 Posted April 13 Excellent. Thank you for sharing. Are you the author of https://github.com/MathiasStadler/orange-pi-zero-boot-from-spi or one of its consumers? 0 Quote
ricaoalberto Posted April 14 Author Posted April 14 No, I just made a few modifications to make it work on this board. 0 Quote
karin Posted Wednesday at 11:32 PM Posted Wednesday at 11:32 PM (edited) Thanks a lot, It works! I've bought the orange pi zero 2 rencently, with also the board version v1.5, but in my case it seems that "pull PC5 to GND" is still needed, which is written at wiki: Quote https://linux-sunxi.org/Xunlong_Orange_Pi_Zero2#SPI_booting I use the latest Armbian IoT based on Ubnutu: Quote Armbian_25.5.1_Orangepizero2_noble_current_6.12.23_minimal.img.xz So it may have some variant? Whatever, as it says: "pull PC5 to GND", I used a 2pin jumper(header) to shortcut the pin13(PC5) and pin14 rather than pin13 and pin9, since they are next to each other, and it works! 🙂 So I posted here in case someone runs into the same issue. Edited Wednesday at 11:56 PM by karin 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.