2011-05-30 12:51:04     Preparing an environment variable image

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2011-05-30 12:51:04     Preparing an environment variable image

Timur Aydin (TURKEY)

Message: 100941   

 

Hi,

 

I am using a separate, dedicated sector to store the u-boot environment variables. But when programming the SPI EEPROM for the first time, this separate sector is blank and u-boot defaults to its default environment. I have to enter u-boot command line and do a saveenv in order to have a valid environment.

 

Is there a way to prepare an image file that contains all of my environment variables, together with a valid CRC checksum? This way, I can just write this image into the dedicated sector and u-boot will not issue the "warning, using default environment" message...

QuoteReplyEditDelete

 

 

2011-05-30 12:57:01     Re: Preparing an environment variable image

Timur Aydin (TURKEY)

Message: 100942   

 

I know that I can do a "saveenv" and then dump the contents of the environment variable sector into a file, but I am looking for a solution that can be integrated into the build process. I am thinking about a C program that incorporates all u-boot environment related code and that also includes the bfin_adi_common.h header file, but is built for the HOST instead of for the blackfin target. This way, this program can be executed as part of the u-boot build process and it just creates a binary image that represents the current default u-boot environment.

QuoteReplyEditDelete

 

 

2011-05-30 12:59:33     Re: Preparing an environment variable image

Mike Frysinger (UNITED STATES)

Message: 100944   

 

what you describe isnt a problem.  u-boot itself has a compiled in default env and when you load up and just type "saveenv", you have the exact same result -- the default env gets written to the env sector.

 

if you really want to bother with this, the tools/envcrc helper has a --binary option which will give you the raw env.

QuoteReplyEditDelete

Attachments

    Outcomes