[U-Boot] uboot env in mmc partition

Hannes Petermaier Hannes.Petermaier at br-automation.com
Mon Sep 1 06:54:36 CEST 2014


> HI there,
Hi Naitik,

> 
> I recently made changes to my system, where I created a new partition on 

> my mmc. (mmcblk0p4)

do you use MMC or eMMC ?
I guess eMMC.

> 
> Then i dd'd a uboot env image into this partition, updated the 
> fw_env.config to point to /dev/mmcblk0p4. At this point, my fw_printenv 
> and fw_setenv work good. So as a next step, I am tried to modify uboot 
to 
> make it point to my env image in my new partition.
> 
> I made below changes to my config header and rebuilt the uboot. On doing 

> printenv from uboot, I dont see the same env that I pushed it from 
linux, 
> infact I see it as its defined in the config header.
> 
> Can some one help ?
> 
> /* environment setting for MMC */
> #ifdef CONFIG_ENV_IS_IN_MMC
> #define CONFIG_SYS_MMC_ENV_DEV          0       /* device 0 */
> #define CONFIG_SYS_MMC_ENV_PART         4
> #define CONFIG_ENV_OFFSET               0       /* just after the MBR */
> #endif

I understand this #defines as following:

CONFIG_SYS_MMC_ENV_DEV says: use mmc-device #0
CONFIG_SYS_MMC_ENV_PART says: use partition #4
i know that u-boot is using the boot-partitions to store the environment, 
an emmc only has 2 partitions.
So #4 is a an illegal paramater

CONFIG_ENV_OFFSET is an absolute address within the device/partition so it 
is not "just after the MBR", instead the environment is "instead the MBR"

best regards,
Hannes




More information about the U-Boot mailing list