Generating u-boot env file (for MfgTool) from Yocto

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Generating u-boot env file (for MfgTool) from Yocto

3,642 Views
colinhelliwell
Contributor III

I'm using Yocto, and have patched u-boot to customise its default environment, but am looking for a way to have bitbake spit out an env file for use by MfgTool - generated from the patched source/image.

Are there any extra options or build targets I can hook into?

I've seen the suggestion in this thread - U-Boot environment variables from MfgTool  - but the method seems to require entering the envars into a text file. I'd like to have it generated from the source/image itself, otherwise it's an additional file to have to keep in sync.

Labels (1)
0 Kudos
3 Replies

1,845 Views
b36401
NXP Employee
NXP Employee

Additionally you can use "Environment Configuration" section in u-boot header file to build u-boot with custom default environment variables.
Please refer this discussion for the details:

http://ltib.nongnu.narkive.com/CEjtd9HJ/u-boot-default-environment-variables-location

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,845 Views
colinhelliwell
Contributor III

Yes, that is how I've done it - patched the header file to modify CONFIG_EXTRA_ENV_SETTINGS.

The trouble is that, with MfgTool, it seems that a default (shipped with the tool) environment is programmed into the board. I can give it a custom .env [text] file to append/modify this default, so was wondering if there was anything in u-boot/yocto that already automatically generated this - or even something close to it - from my u-boot (i.e. whatever is in the source).

The header file itself contains other #defines in CONFIG_EXTRA_ENV_SETTINGS - perhaps a little more processing of it is needed. Or - more complex - parsing elf-style header info in the binary in order to find the region of the image with the env data?

0 Kudos

1,845 Views
b36401
NXP Employee
NXP Employee

You can find environment as set of null-terminated strings in the image.
I mean you can change the environment directly in boot image without u-boot rebuilding.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos