以下步驟均在Armbian系統中完成
一、無內存卡啟動
1.使用armbian-config啟動SPI
輸入sudo armbian-config→選中System並回車→選中Hardware並回車→選中spi-spidev,用空格激活→左右方向鍵選中Save並回車→左右方向鍵選中Back並回車→選中Reboot並回車
等待重啟完成即可
重啟后輸入ls /dev,可在設備列表當中看到一個名為spidev0.0的設備
2.生成uboot鏡像文件
輸入apt search linux-u-boot-orangepizeroplus,查看以下兩個包是否有[installed]字樣
linux-u-boot-orangepizeroplus-dev
linux-u-boot-orangepizeroplus-next
若兩者都沒有出現[installed](情況少見),則輸入sudo apt install linux-u-boot-orangepizeroplus-next,等待安裝完成后進入下一步
若其中任意一個包有[installed],則執行以下命令
cd
dd if=/dev/zero count=2048 bs=1K | tr '\000' '\377' > spi.img
dd if=/usr/lib/linux-u-boot-next-orangepizeroplus_5.85_arm64/sunxi-spl.bin of=spi.img bs=1k conv=notrunc
dd if=/usr/lib/linux-u-boot-next-orangepizeroplus_5.85_arm64/u-boot.itb of=spi.img bs=1 seek=32768 conv=notrunc
其中linux-u-boot-next-orangepizeroplus_5.85_arm64用自己系統中的對應路徑去替換,方法是輸入ls /usr/lib,查看名字以linux-u-boot開頭的文件夾
之后在用戶目錄下會有一個大小為2097152字節的spi.img文件
3.安裝flashrom
輸入sudo apt install flashrom
4.寫入uboot
輸入sudo flashrom -p linux_spi:dev=/dev/spidev0.0 -c MX25L1605 -w spi.img
過程中可能出現Erasing and writing flash chip... FAILED和ERASE FAILED!
但只要最后顯示
Erase/write done.
Verifying flash... VERIFIED.
則說明寫入成功
5.測試U盤啟動
先挑一塊質量好的U盤,使用Etcher
向U盤寫入Armbian的鏡像文件
香橙派關機拔電源,取出內存卡,將寫好的U盤插入香橙派,插電開機啟動即可
二、有內存卡啟動
可參考這篇文章
(尚未驗證此法是否可行)
2019.07.11