UBoot Environment Variables at end of eMMC memory

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

UBoot Environment Variables at end of eMMC memory

758 Views
dvlogic
Contributor III

I'm trying to place our U-Boot environment variables at the end of phsyical eMMC memory (this is mostly so they don't get erased each time a board is re-flashed with a .wic file).

My eMMC memory size is 4GB.

In the UBoot defconfig I set the following:

CONFIG_ENV_SIZE=0x1000
CONFIG_ENV_OFFSET=0xFFFFE000
CONFIG_ENV_OFFSET_REDUND=0xFFFFF000


In my fw_env.config file I set the same

# MTD Device Offset Length Erase Sector Size
/dev/mmcblk2 0xFFFFE000 0x1000 0x200
/dev/mmcblk2 0xFFFFF000 0x1000 0x200

When I try to use fw_printenv I get an error saying it can't read the environment.

I also see my environment variables in the /dev/mmcblk2, but they are at offset 0xE3FFF000.  I've tried to set that as the offset in fw_env.config but still no luck.

Any ideas?

P.S. Everything works as expected if I set the offset to 0x400000 in both the UBoot defconfig and fw_env.config

 

0 Kudos
2 Replies

739 Views
BiyongSUN
NXP Employee
NXP Employee

For the block device emmc, the grammar for that is 

# Block device example
#/dev/mmcblk0 0xc0000 0x20000
#/dev/mmcblk0 -0x20000 0x20000

 

the only need is offset and env size. it is not mtd or ubi device.

  you can use "-"  negative offset is treated as a backwards offset from the
 end of the device/partition, rather than a forwards offset from the start.

and it is bad for putting the env at the end of the device. 

Because the sector on emmc/sdcard is a little bit different for each single one.

you can check with fdisk

and it makes no flexible for making partitions such as rootfs.

 

 

0 Kudos

743 Views
jimmychan
NXP TechSupport
NXP TechSupport

I think the partition setting is not match the ENV OFFSET you used in u-boot defconfig. You may need to use the UUU to run your own script to write the image one by one to the board. There is an example of UUU script in demo image folder. You can refer to the "example_kernel_emmc.uuu".

0 Kudos