
🍊香橙派OrangePi Zero2w U盘引导
0x00 又闲了
前几天闲着没事,买了个OrangePi Zero2w玩。虽然性能一般般,但胜在便宜。
⚠买来才发现Linux下没有GPU驱动,视频都看不利索。想硬解视频必须得用Android。
因为板子需要TF卡启动,到手以后又着急想玩,于是跑到家附近的DAISO随便买了一张TF卡,32G,550日元。
结果没玩两天卡就坏了,本来想试着修修,结果插电脑上没任何反应,白瞎550。当时手头没有其他SD卡了,但是有个性能很强的U盘,于是就想要不用它试试?
看了一遍官方文档,没有提及能否从USB引导。用balenaEtcher写了个系统到U盘,插上开机,也确实没能启动,直接进到了板载NOR的迷你Linux里。
✳后来去秋叶原,闪迪64G的High Endurance才550,感觉自己更2B了。
0x01 换个思路 (Thinking out of the box)
TF卡的可靠性还是不太行,既然板子上有一块16M的NOR FLASH,不然用它装个u-boot从USB引导试试?
Since TF card is so unstable, what if I put a uboot on the NOR FLASH, and boot from there?
1. 修改系统配置 (Edit system config)
想读写这个NOR FLASH,首先还是得从TF启动一个Linux系统,从这个系统里修改硬件配置才可以。
Before r/w that NOR, you first need to boot a Linux system from the TF card, and then modify the hardware configuration from that system using "orangepi-config".
1 | orangepi-config → System → Hardward |
激活spi0-spidev 重启
Enable spi0-spidev and reboot.
重启完成后,手动确认spi设备是否存在。
After reboot, check if spi device exist.
1 | ls /dev #查看是否有/dev/spidev0.0 |
2. 获取u-boot (Get u-boot)
查看uboot文件是否已经存在,存在时会输出以下结果
Check if uboot file exist.
1 | apt search linux-u-boot-orangepizero2w-next |
如果不存在的话,需要执行
If not, run
1 | apt install linux-u-boot-orangepizero2w-next |
安装完成后,执行。应该会存在一个u-boot-sunxi-with-spl.bin文件。
After installation, check if u-boot-sunxi-with-spl.bin file exist.
1 | ls -l /usr/lib/linux-u-boot-next-orangepizero2w_1.0.4_arm64/ |
3. 制作u-boot启动镜像 (Create u-boot image)
创建一个空文件夹,用于存放接下来需要用到的文件
Create a empty folder, for next steps.
1 | mkdir /home/orangepi/uboot |
执行以下命令 Run the following
1 | cd /home/orangepi/uboot #切换至刚刚创建的目录 |
顺利写入完成后会出现Verifying flash... VERIFIED.
4. 测试 (Test)
将OrangePi关机,拔掉TF卡,用balenaEtcher将系统镜像写入U盘,把U盘插到Zero2w上开机。
Shut down the OrangePi, remove the TF card, use balenaEtcher to make a bootable usb device, then plug the USB drive into the Zero2w and boot it up.