I am working with an embedded linux kit that is running u-boot. In order to get everything booting properly, I had to modify some environment variables and store them with the 'saveenv' command.
Now I would like to go back and see what the defaults were, verify that I know exactly what was changed, and figure out a way to change those defaults so that each unit in production won't need to be individually booted and modified.
Is there a way to tell u-boot to clear any saved data so I can see what the defaults are again? The flash type is QSPI if that makes a difference.
The U-Boot environment is stored in the SD Card memory and is persistent across power or reset cycles. Parameters defined by the U-boot environment variables include: target IP address, target MAC address, location in RAM where a Linux bootable image will be loaded, and many others.
The dsadmin command can be used for deleting an environment variable in a particular project.
The eraseenv
is not defined in my case. According to @Joshua's answer, I find the following command does what eraseenv
does.
env default -a
saveenv
On your kit, try
help env
and look for "env default".
env default [-f] var [...] - [forcibly] reset variable(s) to their default values
That sounds like what you are looking for.
env default -a
does a nonpersistent change, then "printenv" shows the defaults.
To change defaults, you would rebuild your u-boot.bin with changes e.g. to CONFIG_EXTRA_ENV_SETTINGS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With