cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
11,690 Views
Registered: ‎08-05-2015

What is the proper way to set U-Boot default environment variables at compile time?

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.

 

--Jeff

 

0 Kudos
4 Replies
Highlighted
Visitor
Visitor
6,977 Views
Registered: ‎04-10-2016

I think you are supposed to update CONFIG_EXTRA_EN_SETTINGS in

./subsystems/linux/configs/u-boot/platform-auto.h

Highlighted
1,180 Views
Registered: ‎12-12-2019

How can I reset my u-boot environment to the manufacturing one?

0 Kudos
Highlighted
Scholar
Scholar
1,168 Views
Registered: ‎05-28-2013

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).

Highlighted
1,156 Views
Registered: ‎12-12-2019

Thank you very much! It works great!
0 Kudos