How do I clear environment variables previously saved with u-boot?

Viewed 46252

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.

4 Answers

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
# add uboot env variable
setenv my_var 1

# printenv my_var
my_var=1

# remove/unset uboot env variable
setenv my_var

# printenv my_var
## Error: "my_var" not defined
Related