树莓派4B启动方式
树莓派 4B启动方式官方文档详见:
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-boot-flow
树莓派配置中有一项BOOT_ORDER的设置可以设置启动方式
BOOT_ORDER的值是32位无符号整形
4位代表一个启动模式,共可以设置8个启动方式
从低位开始:
- 0~3bit:第一优先级启动方式
- 4~7bit:第二优先级启动方式
- 8~11bit:第三优先级启动方式
- 12~15bit:第四优先级启动方式
- 16~19bit:第五优先级启动方式
- 20~23bit:第六优先级启动方式
- 24~27bit:第七优先级启动方式
- 28~31bit:第八优先级启动方式
值 | 启动模式 | 描述 |
---|---|---|
0x0 | sdcard识别 | 已废弃 0xF (重启)模式替代 |
0x1 | scard启动 | sdcard(all raspi board)或emmc启动(CM4) |
0x2 | 网络启动 | 网络启动,参考文档描述 |
0x3 | rpiboot | RPIBOOT-usbboot树莓派以usb otg方式从pc机rpiboot服务程序启动 |
0x4 | U盘启动 | U盘启动 |
0x5 | BCM-USB-MSD | USB 2.0 boot from USB Type C socket (CM4: USB type A socket on CM4IO board). |
0x6 | NVME | CM4 only: boot from an NVMe SSD connected to the PCIe interface. See NVMe boot for more details. |
0xE | STOP | Stop and display error pattern. A power cycle is required to exit this state. |
0xF | 重启 | Restart from the first boot-mode in the BOOT_ORDER field i.e. loop |
示例:
BOOT_ORDER=0xf41
先sdcard启动,如果没sdcard再尝试U盘启动,如果都尝试失败则重启
BOOT_ORDER=0xf14
先U盘启动,U盘无则sdcard启动,如果都尝试失败则重启
BOOT_ORDER=0xf21
先sdcard启动,无sdcard,则网络启动,都尝试失败则重启