i.MX51 EVK Changing Env

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

i.MX51 EVK Changing Env

i.MX51 EVK Changing Env

Changing the storage for U-boot environment variables

 

U-Boot on Freescale BSP has a compiling option that allows you to choose the storage for environment variables.

 

1 - Extract the u-boot source using LTIB:

./ltib -m prep -p u-boot 
 

2 - The source will be extracted to <ltib path>/rpm/BUILD/u-boot-2009.08

 

3 - On u-Boot source locate the i.MXEVK config file, <ltib path>/rpm/BUILD/u-boot-2009.08/include/configs/mx51_bbg.h

 

4 - To change the storage of variables environment to SD card, on this file, comment out CONFIG_FSL_ENV_IN_SF and define CONFIG_FSL_ENV_IN_MMC:

 

//#define CONFIG_FSL_ENV_IN_SF

 

#define CONFIG_FSL_ENV_IN_MMC

5 - Adjust CONFIG_ENV_SECT_SIZE and CONFIG_ENV_OFFSET accordingly. Recall that sd card read block size is 512B.

 

For example:

 

#define CONFIG_ENV_SECT_SIZE (256 * 512)

 

#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE

 

#if defined(CONFIG_FSL_ENV_IN_MMC)

 

#define CONFIG_ENV_IS_IN_MMC 1 #define CONFIG_ENV_OFFSET (1023 * 512)

 

6 - Save the file.

 

7 - Recompile u-boot:

./ltib -m scbuild -p u-boot 
 

8 - Your new compiled u-boot image will be saved at: <ltib path>/rpm/BUILD/u-boot-2009.08/u-boot.bin

Labels (1)
%3CLINGO-SUB%20id%3D%22lingo-sub-1122750%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ei.MX51%20EVK%20Changing%20Env%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122750%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3E%3CH1%20id%3D%22toc-hId-382398481%22%20id%3D%22toc-hId-382398481%22%20id%3D%22toc-hId-1297630862%22%3E%3CSPAN%20class%3D%22mw-headline%22%3EChanging%20the%20storage%20for%20U-boot%20environment%20variables%3C%2FSPAN%3E%3C%2FH1%3E%26nbsp%3B%20%3CP%3EU-Boot%20on%20Freescale%20BSP%20has%20a%20compiling%20option%20that%20allows%20you%20to%20choose%20the%20storage%20for%20environment%20variables.%3C%2FP%3E%26nbsp%3B%20%3CP%3E1%20-%20Extract%20the%20u-boot%20source%20using%20LTIB%3A%3C%2FP%3E%3CPRE%20class%3D%22jive-pre%22%3E.%2Fltib%20-m%20prep%20-p%20u-boot%20%3C%2FPRE%3E%26nbsp%3B%20%3CP%3E2%20-%20The%20source%20will%20be%20extracted%20to%20%3CLTIB%20path%3D%22%22%3E%2Frpm%2FBUILD%2Fu-boot-2009.08%3C%2FLTIB%3E%3C%2FP%3E%26nbsp%3B%20%3CP%3E3%20-%20On%20u-Boot%20source%20locate%20the%20i.MXEVK%20config%20file%2C%20%3CLTIB%20path%3D%22%22%3E%2Frpm%2FBUILD%2Fu-boot-2009.08%2Finclude%2Fconfigs%2Fmx51_bbg.h%3C%2FLTIB%3E%3C%2FP%3E%26nbsp%3B%20%3CP%3E4%20-%20To%20change%20the%20storage%20of%20variables%20environment%20to%20SD%20card%2C%20on%20this%20file%2C%20comment%20out%20CONFIG_FSL_ENV_IN_SF%20and%20define%20CONFIG_FSL_ENV_IN_MMC%3A%3C%2FP%3E%3CBLOCKQUOTE%20class%3D%22jive-quote%22%3E%26nbsp%3B%20%3CP%3E%2F%2F%23define%20CONFIG_FSL_ENV_IN_SF%3C%2FP%3E%26nbsp%3B%20%3CP%3E%23define%20CONFIG_FSL_ENV_IN_MMC%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3E5%20-%20Adjust%20CONFIG_ENV_SECT_SIZE%20and%20CONFIG_ENV_OFFSET%20accordingly.%20Recall%20that%20sd%20card%20read%20block%20size%20is%20512B.%3C%2FP%3E%26nbsp%3B%20%3CP%3EFor%20example%3A%3C%2FP%3E%3CBLOCKQUOTE%20class%3D%22jive-quote%22%3E%26nbsp%3B%20%3CP%3E%23define%20CONFIG_ENV_SECT_SIZE%20(256%20*%20512)%3C%2FP%3E%26nbsp%3B%20%3CP%3E%23define%20CONFIG_ENV_SIZE%20CONFIG_ENV_SECT_SIZE%3C%2FP%3E%26nbsp%3B%20%3CP%3E%23if%20defined(CONFIG_FSL_ENV_IN_MMC)%3C%2FP%3E%26nbsp%3B%20%3CP%3E%23define%20CONFIG_ENV_IS_IN_MMC%201%20%23define%20CONFIG_ENV_OFFSET%20(1023%20*%20512)%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%26nbsp%3B%20%3CP%3E6%20-%20Save%20the%20file.%3C%2FP%3E%26nbsp%3B%20%3CP%3E7%20-%20Recompile%20u-boot%3A%3C%2FP%3E%3CPRE%20class%3D%22jive-pre%22%3E.%2Fltib%20-m%20scbuild%20-p%20u-boot%20%3C%2FPRE%3E%26nbsp%3B%20%3CP%3E8%20-%20Your%20new%20compiled%20u-boot%20image%20will%20be%20saved%20at%3A%20%3CLTIB%20path%3D%22%22%3E%2Frpm%2FBUILD%2Fu-boot-2009.08%2Fu-boot.bin%3C%2FLTIB%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1122750%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX51%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
‎09-10-2020 02:55 AM
Updated by: