如下步驟均在Armbian系統中完成linux
輸入sudo armbian-config→選中System並回車→選中Hardware並回車→選中spi-spidev,用空格激活→左右方向鍵選中Save並回車→左右方向鍵選中Back並回車→選中Reboot並回車
等待重啓完成便可ide
重啓後輸入ls /dev,可在設備列表當中看到一個名爲spidev0.0的設備測試
輸入apt search linux-u-boot-orangepizeroplus,查看如下兩個包是否有[installed]字樣spa
linux-u-boot-orangepizeroplus-dev
linux-u-boot-orangepizeroplus-nextip
若二者都沒有出現[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=notruncget
其中linux-u-boot-next-orangepizeroplus_5.85_arm64用本身系統中的對應路徑去替換,方法是輸入ls /usr/lib,查看名字以linux-u-boot開頭的文件夾
以後在用戶目錄下會有一個大小爲2097152字節的spi.img文件flash
輸入sudo apt install flashromit
輸入sudo flashrom -p linux_spi:dev=/dev/spidev0.0 -c MX25L1605 -w spi.imgio
過程當中可能出現Erasing and writing flash chip... FAILED和ERASE FAILED!
但只要最後顯示
Erase/write done.
Verifying flash... VERIFIED.
則說明寫入成功
先挑一塊質量好的U盤,使用Etcher 向U盤寫入Armbian的鏡像文件
香橙派關機拔電源,取出內存卡,將寫好的U盤插入香橙派,插電開機啓動便可
可參考這篇文章 (還沒有驗證此法是否可行)
2019.07.11