I'm using u-boot on raspberry pi 4, A/B booting from USB attached SSD, integrated with mender without yocto. Everything works fine except the env saving: initially configured to use MMC and offsets, fw_printenv
complained about a bad CRC and output the default config instead. I changed the env saving to FAT files on the boot partition, and I'm now troubleshooting 2 issues:
uboot.env
does not get written by issuingsaveenv
in the u-boot promptuboot-redund.env
gets written but its CRC is incorrect.
I'm checking the CRC by issuing the fw_printenv
command from linux. Its config file states:
/boot/u-boot/uboot-redund.env 0x0000 0x4000
U-Boot is compiled with 0x4000
as env size, and using hexdump
to check the file shows a correct file with a length of 0x4000.
When booting up, u-boot outputs the following log over TTL serial:
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
which shows that u-boot does load the env from FAT correctly.
How can I investigate further why u-boot does not write uboot.env, and why when it does write uboot-redund.env, writes it with a wrong CRC from fw_printenv
's point of view?