RPi3B+ U-Boot Saveenv fails

Short story...

My RPi3+ fails to save my edited u-boot environment.

Code:
U-Boot> editenv usb_pgood_delay
edit: 10000
U-Boot> saveenv
Saving Environment to FAT... Failed (1)
U-Boot>

Any suggestions about what I should look at?

Long story...

I'm trying to get my RPi 3B+ to mount home on an external USB HD, but the external HD spins down just as the filesystems are being checked. The home dir on the HD isn't found, and FreeBSD drops down to single user mode. The HD is found about 3 seconds later, and I can exit single user mode to finish booting.

Weirdly, the swap partition on the HD is found and works without problem.

I switched to an external SSD, and that works fine. home and the swap are found and mounted without any problems.

I started working throught Bob Prohaska's notes as linked in the FreeBSD Arm wiki, and that's when I got to the u-boot saveenv problem.

Code:
% uname -a
FreeBSD gopher 13.0-RELEASE-p11 FreeBSD 13.0-RELEASE-p11 #0: Tue Apr  5 18:58:59 UTC 2022     root@arm64-builder.daemonology.net:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC  arm64
 
Just a +1 but I remember this issue about 2 years ago on an RPI2B. Naughty me forgot to log a PR about it, so perhaps you could?
 
Go to bugs.freebsd.org, sign up, enter PR with what you've written above. If you make a mistake one of the triagers will amend it so don't worry about that. Just give as much relevant information as you did above and hopefully someone will look at it quickly and ask you to test/confirm etc.
 
What's the PR? I'm running into this issue with the FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img image. I try to set bootdelay to 0 but saveenv fails with "Saving Environment to FAT... Failed (1)"
 
This happened to me, too. I thought savenv fails because it possibly wants to save the environment in the wrong location/device.

I would either write a bug report for the sysutils/u-boot-rpi3 port, or search the arm-mailing list for the keywords "rpi3" and "saveenv" (or write to the arm-mailing list).
 
Just ran into this on RPi4.
I fixed the problem by rebuilding sysutils/u-boot-rpi4 after changing files/rpi4_fragment from :

Code:
CONFIG_ENV_FAT_DEVICE_AND_PART="1:1"
CONFIG_RPI_EFI_NR_SPIN_PAGES=2

to

Code:
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_RPI_EFI_NR_SPIN_PAGES=2

to point to the correct device (MMC 0, partition 1).

I then simply copied work/stage/usr/local/share/u-boot/u-boot-rpi4/u-boot.bin to the FAT filesystem on the MMC, reboot, and:

U-Boot 2021.07 (Feb 17 2023 - 15:09:45 +0100)
DRAM: 1.9 GiB
RPI 4 Model B (0xb03111)
MMC: mmc@7e300000: 3, emmc2@7e340000: 0
[...]
U-Boot> setenv bootdelay 5
U-Boot> saveenv
Saving Environment to FAT... OK


The uboot.env file is automatically created. And everything works fine.
 
Back
Top