04-19-2016 09:22 PM
What is the proper way to set U-Boot default environment variables at compile time? I can boot into U-Boot and modify environment variables and do 'saveenv' without problems, but I'd like to change some of the defaults that are in my BOOT.BIN image. Is there a supported way to do this? I didn't want to start hacking the code in a fragile way to make it work if there is a supported mechanism.
I'm building with the petalinux-config, petalinux-build and petalinux-package tools.
02-17-2020 03:55 PM
You can use the u-boot command "env default -a -f" to reset back to the default environment. Follow this by "saveenv" if you want the changes to be persistent.
Another method is to erase the area where the environment is stored. This is often a partition in QSPI or a file on the SD card. If you do this, upon next boot, u-boot will complain about "invalid CRC" and then will use the default environment (that was compiled into the u-boot binary).