【发布时间】:2021-09-01 03:04:18
【问题描述】:
我在树莓派 4 上使用 u-boot,从 USB 连接的 SSD 启动 A/B,与没有 yocto 的修补程序集成。除了 env 保存之外,一切正常:最初配置为使用 MMC 和偏移量,fw_printenv 抱怨 CRC 错误并改为输出默认配置。我将 env 保存更改为引导分区上的 FAT 文件,我现在正在解决 2 个问题:
-
uboot.env不会通过在 u-boot 提示符中发出saveenv来写入 -
uboot-redund.env已写入,但其 CRC 不正确。
我正在通过从 linux 发出 fw_printenv 命令来检查 CRC。它的配置文件状态:
/boot/u-boot/uboot-redund.env 0x0000 0x4000
U-Boot 编译时使用0x4000 作为环境大小,使用hexdump 检查文件显示正确的文件,长度为0x4000。
开机时,u-boot通过TTL串口输出如下日志:
U-Boot 2021.07-rc2-00246-gd64b3c608d-dirty (Jun 16 2021 - 12:16:24 +0200)
DRAM: 7.9 GiB
RPI 4 Model B (0xd03114)
MMC: mmcnr@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... In: serial
Out: vidconsole
Err: vidconsole
Net: eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 3 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot: 0
这表明 u-boot 确实从 FAT 中正确加载了环境。
我如何进一步调查为什么 u-boot 不写入 uboot.env,以及为什么在写入 uboot-redund.env 时,从fw_printenv 的角度来看,写入的 CRC 错误?
【问题讨论】:
-
fw_printenv (github.com/sbabic/libubootenv) 可以与 CONFIG_ENV_IS_IN_FAT 一起使用,但不能与 CONFIG_ENV_IS_IN_FLASH 一起使用。您在 .config 文件中指定了什么?
-
嗨@Xypron .config 文件确实指定了
CONFIG_ENV_IS_IN_FAT而不是FLASH
标签: environment-variables usb u-boot fat