How to program uboot environment in emmc

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

How to program uboot environment in emmc

1,372 Views
vin_imd
Contributor II

Hi All,

I'm trying to figure out how to program uboot environment parameters in emmc when programming the board for the first time. I'm using "UUU" tool to program the image. The build system is YOCTO. This is a custom board based on i.MX8mp.

This is required for integrating SWUpdate using the dual copy strategy. I'm planning to update the "mmcroot" parameter in Uboot environment once the update is successful. Previously uboot was configured with CONFIG_ENV_IS_NOWHERE=y setting, and it was using default environment on every powerup. Now I have made the following changes to uboot defconfig - 

-CONFIG_ENV_IS_NOWHERE=y
+# CONFIG_ENV_IS_NOWHERE is not set
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_MMC_ENV_DEV=2
+CONFIG_SYS_MMC_ENV_PART=0
+CONFIG_ENV_SIZE=0x4000
+CONFIG_ENV_OFFSET=0x400000
+CONFIG_ENV_SECT_SIZE=0x10000

 

After the build, I have "u-boot-imx-initial-env-sd" file getting created which will be programmed to the emmc. I can't figure out how to do this using the UUU tool.

I'm wondering if I have to create a separate partition for uboot environment in emmc device and provide the below command in wks.in file of meta-freescale/wic/

part u-boot-env --source rawcopy --sourceparams="file=u-boot-imx-initial-env-sd" --ondisk mmcblk --no-table --align 8192

 

Let me know if anybody has looked into this or the best way to get this done.

 

Thanks

 

0 Kudos
2 Replies

962 Views
dhanasekar
Contributor I

Did this technique work out? Were you able to save the environment variables?

0 Kudos

1,360 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @vin_imd 

 

Yes, you can create a separate partition for uboot environment in the wks.in meta-freescale/wic/.

0 Kudos