使用我自己编译的内核映像在 BeagleboneBlack 中 U-Boot 启动失败?
U-Boot boot-up fail in BeagleboneBlack using my own compiled kernel image?
我正在尝试根据以下教程使用 Buildroot 编译内核:http://free-electrons.com/doc/training/buildroot/buildroot-labs.pdf .
我严格按照所有步骤操作,当我将SD卡插入BeagleboneBlack(USB线供电)时,选择从SD卡启动,启动不成功。控制台输出如下:
U-Boot 2017.09 (Sep 27 2017 - 17:41:38 +0200)
CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
<ethaddr> not set. Validating first E-fuse MAC
Net: cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
98 bytes read in 4 ms (23.4 KiB/s)
Loaded env from uEnv.txt
Importing environment from mmc0 ...
Running uenvcmd ...
** Bad device 0:1 0x82000000 **
reading ramdisk.gz
** Unable to read file ramdisk.gz **
** Bad device 0:1 0x88000000 **
** Bad device 0:1 0x88000000 **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /am335x-boneblack.dtb
35712 bytes read in 10 ms (3.4 MiB/s)
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** File not found /zImage **
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
** File not found /zImage **
## Error: "bootcmd_nand0" not defined
starting USB...
USB0: Port not available.
cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
musb-hdrc: peripheral reset irq lost!
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
BOOTP broadcast 18
BOOTP broadcast 19
BOOTP broadcast 20
BOOTP broadcast 21
BOOTP broadcast 22
BOOTP broadcast 23
BOOTP broadcast 24
BOOTP broadcast 25
BOOTP broadcast 26
BOOTP broadcast 27
BOOTP broadcast 28
BOOTP broadcast 29
Retry time exceeded; starting again
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-98-84-e3-ae-c4-14
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/00000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/00000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/00
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm-am33xx
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Config file not found
starting USB...
USB0: Port not available.
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
BOOTP broadcast 18
BOOTP broadcast 19
BOOTP broadcast 20
BOOTP broadcast 21
BOOTP broadcast 22
BOOTP broadcast 23
BOOTP broadcast 24
BOOTP broadcast 25
BOOTP broadcast 26
BOOTP broadcast 27
BOOTP broadcast 28
BOOTP broadcast 29
Retry time exceeded; starting again
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
BOOTP broadcast 18
BOOTP broadcast 19
BOOTP broadcast 20
BOOTP broadcast 21
BOOTP broadcast 22
BOOTP broadcast 23
BOOTP broadcast 24
BOOTP broadcast 25
BOOTP broadcast 26
BOOTP broadcast 27
BOOTP broadcast 28
BOOTP broadcast 29
Retry time exceeded; starting again
=>
这是我在 uEnv.txt 文件中写的:
bootdir=
bootpart=0:1
uenvcmd=run loadimage;run loadramdisk;run findfdt;run loadfdt;run mmcloados
谁能告诉我我做错了什么(尽可能具体)?好像boot找不到zImage,但是在/boot分区,我有zImage文件。
非常感谢。
Can anyone tell me what I'm doing wrong (as specific as possible)?
U-Boot启动环境貌似和SD卡不一致
默认的 U-Boot 环境设置为从 SD 卡第二分区的 /boot 目录加载内核、DT blob 或 FIT 映像。改为从第一个分区(即 uEnv.txt 文件)加载的修改仅部分有效。
您声称:
... but in the /boot partition, I do have zImage file.
(/boot 将是一个目录而不是 "partition"。)
假设以上是准确的,那么内核映像文件的完整路径是根文件系统中的 /boot/zImage。
但是启动日志报告说
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** File not found /zImage **
表示内核在第一个分区的根目录/中查找,而不是在第一个分区的/boot中查找根文件系统。
您的 SD 卡可能在第一个分区中有 FAT fs,而不是 ext3/4 根文件系统。
但是启动日志确实表明在根目录中找到了设备树 blob,/
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /am335x-boneblack.dtb
35712 bytes read in 10 ms (3.4 MiB/s)
通常内核文件与 DT blob 一起存储(在同一目录中)。
但是你好像把这两个文件分开了。
将两个文件都存储在 FAT 文件系统的根目录 / 中(以及缺少的 ramdisk.gz) ,
或者
修复环境中的加载命令和路径和将根文件系统安装在SD卡上的另一个分区中。
前者最简单(即复制 zImage)。
该解决方案需要研究环境变量以进行适当的更改(例如,uEnv.txt 中的 bootdir=/boot
可能是修复的一部分)。
更新
我查看了 U-Boot 2017.09 及其为您的开发板构建的默认环境。可疑的环境变量是
bootcmd_legacy_mmc0=setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot
其中 setenv bootpart 0:2
指定 rootfs 分区(而不是 VFAT/"boot" 分区)是源分区。
此 setenv 将覆盖在读取和评估 uEnv.txt 文件时分配的 bootpart=0:1
。
相反,为文件指定 /boot 目录的默认 bootdir=/boot
被 uEnv.txt[=123 中的 bootdir=
覆盖=] 文件.
最终结果是,当mmcboot及其loadimage变量为运行时, zImage 将从 rootfs 的根目录加载,失败是因为该文件在 /boot 目录中。
SD/MMC found on device 0
** File not found /zImage **
请注意,加载错误之前的 "SD/MMC found on device 0" 消息来自 mmcboot 变量中的 echo
命令:
mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; \
if mmc rescan; then \
echo SD/MMC found on device ${mmcdev}; \
if run loadimage; then \
if test ${boot_fit} -eq 1; \
then run loadfit; \
else run mmcloados; \
fi; \
fi; \
fi;
解决方法
一个。要从第一个分区加载,修改变量 bootcmd_legacy_mmc0 以使用 bootpart[= 的当前定义加载 zImage 123=],即不要重新定义它。编辑 U-Boot 源代码并重建,或使用以下 U-Boot 命令(after 中止自动引导,before 引导失败):
setenv bootcmd_legacy_mmc0 'setenv mmcdev 0\; run mmcboot'
bootd
或
乙。修改uEnv.txt文件。只需插入新的第一行:
devtype=mmc
附录
It is indeed the version incompatibility issue.
如果您坚持使用 U-Boot 2017.09,那么解决方法 B 就足够了。
U-Boot 2016.03 有 loadimage=load mmc ${bootpart} ...
,而
U-Boot 2017.09 有 loadimage=load ${devtype} ${bootpart} ...
.
当 uenvcmd 是 uEnv.txt[=123= 中的 运行 时,变量 devtype 未定义] 文件。因此,较新版本的 U-Boot 会生成错误消息
** Bad device 0:1 0x82000000 **
** Bad device 0:1 0x88000000 **
** Bad device 0:1 0x88000000 **
解决方法 B 确保在 uenvcmd 为 运行 时定义 devtype,因此 load
命令访问mmc
设备与旧版本一样。
我正在尝试根据以下教程使用 Buildroot 编译内核:http://free-electrons.com/doc/training/buildroot/buildroot-labs.pdf .
我严格按照所有步骤操作,当我将SD卡插入BeagleboneBlack(USB线供电)时,选择从SD卡启动,启动不成功。控制台输出如下:
U-Boot 2017.09 (Sep 27 2017 - 17:41:38 +0200)
CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
<ethaddr> not set. Validating first E-fuse MAC
Net: cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
98 bytes read in 4 ms (23.4 KiB/s)
Loaded env from uEnv.txt
Importing environment from mmc0 ...
Running uenvcmd ...
** Bad device 0:1 0x82000000 **
reading ramdisk.gz
** Unable to read file ramdisk.gz **
** Bad device 0:1 0x88000000 **
** Bad device 0:1 0x88000000 **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /am335x-boneblack.dtb
35712 bytes read in 10 ms (3.4 MiB/s)
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** File not found /zImage **
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
** File not found /zImage **
## Error: "bootcmd_nand0" not defined
starting USB...
USB0: Port not available.
cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
musb-hdrc: peripheral reset irq lost!
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
BOOTP broadcast 18
BOOTP broadcast 19
BOOTP broadcast 20
BOOTP broadcast 21
BOOTP broadcast 22
BOOTP broadcast 23
BOOTP broadcast 24
BOOTP broadcast 25
BOOTP broadcast 26
BOOTP broadcast 27
BOOTP broadcast 28
BOOTP broadcast 29
Retry time exceeded; starting again
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-98-84-e3-ae-c4-14
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/00000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/00000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/00
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm-am33xx
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `serverip' not set
Config file not found
starting USB...
USB0: Port not available.
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
BOOTP broadcast 18
BOOTP broadcast 19
BOOTP broadcast 20
BOOTP broadcast 21
BOOTP broadcast 22
BOOTP broadcast 23
BOOTP broadcast 24
BOOTP broadcast 25
BOOTP broadcast 26
BOOTP broadcast 27
BOOTP broadcast 28
BOOTP broadcast 29
Retry time exceeded; starting again
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 98:84:e3:ae:c4:12
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
BOOTP broadcast 18
BOOTP broadcast 19
BOOTP broadcast 20
BOOTP broadcast 21
BOOTP broadcast 22
BOOTP broadcast 23
BOOTP broadcast 24
BOOTP broadcast 25
BOOTP broadcast 26
BOOTP broadcast 27
BOOTP broadcast 28
BOOTP broadcast 29
Retry time exceeded; starting again
=>
这是我在 uEnv.txt 文件中写的:
bootdir=
bootpart=0:1
uenvcmd=run loadimage;run loadramdisk;run findfdt;run loadfdt;run mmcloados
谁能告诉我我做错了什么(尽可能具体)?好像boot找不到zImage,但是在/boot分区,我有zImage文件。
非常感谢。
Can anyone tell me what I'm doing wrong (as specific as possible)?
U-Boot启动环境貌似和SD卡不一致
默认的 U-Boot 环境设置为从 SD 卡第二分区的 /boot 目录加载内核、DT blob 或 FIT 映像。改为从第一个分区(即 uEnv.txt 文件)加载的修改仅部分有效。
您声称:
... but in the /boot partition, I do have zImage file.
(/boot 将是一个目录而不是 "partition"。)
假设以上是准确的,那么内核映像文件的完整路径是根文件系统中的 /boot/zImage。
但是启动日志报告说
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** File not found /zImage **
表示内核在第一个分区的根目录/中查找,而不是在第一个分区的/boot中查找根文件系统。
您的 SD 卡可能在第一个分区中有 FAT fs,而不是 ext3/4 根文件系统。
但是启动日志确实表明在根目录中找到了设备树 blob,/
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /am335x-boneblack.dtb
35712 bytes read in 10 ms (3.4 MiB/s)
通常内核文件与 DT blob 一起存储(在同一目录中)。
但是你好像把这两个文件分开了。
将两个文件都存储在 FAT 文件系统的根目录 / 中(以及缺少的 ramdisk.gz) ,
或者
修复环境中的加载命令和路径和将根文件系统安装在SD卡上的另一个分区中。
前者最简单(即复制 zImage)。
该解决方案需要研究环境变量以进行适当的更改(例如,uEnv.txt 中的 bootdir=/boot
可能是修复的一部分)。
更新
我查看了 U-Boot 2017.09 及其为您的开发板构建的默认环境。可疑的环境变量是
bootcmd_legacy_mmc0=setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot
其中 setenv bootpart 0:2
指定 rootfs 分区(而不是 VFAT/"boot" 分区)是源分区。
此 setenv 将覆盖在读取和评估 uEnv.txt 文件时分配的 bootpart=0:1
。
相反,为文件指定 /boot 目录的默认 bootdir=/boot
被 uEnv.txt[=123 中的 bootdir=
覆盖=] 文件.
最终结果是,当mmcboot及其loadimage变量为运行时, zImage 将从 rootfs 的根目录加载,失败是因为该文件在 /boot 目录中。
SD/MMC found on device 0
** File not found /zImage **
请注意,加载错误之前的 "SD/MMC found on device 0" 消息来自 mmcboot 变量中的 echo
命令:
mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; \
if mmc rescan; then \
echo SD/MMC found on device ${mmcdev}; \
if run loadimage; then \
if test ${boot_fit} -eq 1; \
then run loadfit; \
else run mmcloados; \
fi; \
fi; \
fi;
解决方法
一个。要从第一个分区加载,修改变量 bootcmd_legacy_mmc0 以使用 bootpart[= 的当前定义加载 zImage 123=],即不要重新定义它。编辑 U-Boot 源代码并重建,或使用以下 U-Boot 命令(after 中止自动引导,before 引导失败):
setenv bootcmd_legacy_mmc0 'setenv mmcdev 0\; run mmcboot'
bootd
或
乙。修改uEnv.txt文件。只需插入新的第一行:
devtype=mmc
附录
It is indeed the version incompatibility issue.
如果您坚持使用 U-Boot 2017.09,那么解决方法 B 就足够了。
U-Boot 2016.03 有 loadimage=load mmc ${bootpart} ...
,而
U-Boot 2017.09 有 loadimage=load ${devtype} ${bootpart} ...
.
当 uenvcmd 是 uEnv.txt[=123= 中的 运行 时,变量 devtype 未定义] 文件。因此,较新版本的 U-Boot 会生成错误消息
** Bad device 0:1 0x82000000 **
** Bad device 0:1 0x88000000 **
** Bad device 0:1 0x88000000 **
解决方法 B 确保在 uenvcmd 为 运行 时定义 devtype,因此 load
命令访问mmc
设备与旧版本一样。