如何在uboot中将sd卡设为默认启动?

gpu*_*guy 6 u-boot sd-card

U-Boot 2013.07 (Nov 21 2013 - 18:12:40)

Memory: ECC disabled
DRAM:  1 GiB
MMC:   zynq_sdhci: 0
SF: Detected N25Q128A with page size 64 KiB, total 16 MiB
In:    serial
Out:   serial
Err:   serial
Net:   Gem.e000b000
Hit any key to stop autoboot:  0
SF: Detected N25Q128A with page size 64 KiB, total 16 MiB
SF: 11010048 bytes @ 0x520000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot-PetaLinux>
Run Code Online (Sandbox Code Playgroud)

然后我会输入run sdboot,它会从 sd 卡启动,我在其中放置了一个用于 sd 启动的图像。

它显示默认情况下 UBoot 从闪存启动。我需要在 uboot 中进行哪些更改以及在哪里进行,以便默认引导设备是 SD 卡而不是闪存?

我必须为此设置任何环境变量吗?

小智 3

要了解有关 u-boot 选项的更多信息,我建议您这样做

U-Boot-PetaLinux> printenv
Run Code Online (Sandbox Code Playgroud)

并查看UBootEnvVariables中提到的特定环境变量的效果。也许你会做出的改变是

U-Boot-PetaLinux> setenv bootcmd 'run sdboot' ; saveenv ; reboot
Run Code Online (Sandbox Code Playgroud)

变量 bootcmd 和 bootargs 是最需要理解的。没有什么是真正困难的,信息就在那里为你提供。