[U-Boot] mx28: Saving env vars on MMC

Marek Vasut marek.vasut at gmail.com
Fri Nov 25 09:13:27 CET 2011


> On 25/11/2011 03:05, Fabio Estevam wrote:
> > Hi,
> > 
> > I am trying to save environment variables on a SD card of a MX28EVK
> > board.
> > 
> > 'save' command reports no errors, but if I reboot the board then the
> > board no longer boots.
> > 
> > In order to recover the boot, I need to reformat the SD card and
> > reflash the u-boot.sd image.
> > 
> > I am trying the following configuration taken from FSL U-boot:
> > 
> > /*
> > 
> >  * MMC Driver
> >  */
> > 
> > #define CONFIG_ENV_IS_IN_MMC
> > #define CONFIG_ENV_OFFSET	0x400
> 
> I do not know the details, but this offset is very low and it seems
> taken from other i.MX (MX5). This can overwrite your U-Boot. The
> write_env() function in env_mmc.c converts the offset in a block number,
> and this means you are writing at the block #2.
> 
> Because 1 Block=512 byte, can you try to move the offset to a very high
> block ?
> 
> > #define CONFIG_ENV_SIZE		0x20000 - 0x400
> 
> This seems too much...
> 
> Stefano

You have to be careful on the imx28 about the following:

1) sector 0 / first 512 bytes : That's where MBR is
2) sector 2048 + ... : That's where U-Boot is located

But it's strange, there's about 1MB of space between MBR and U-Boot ... can you 
actually check the first 2MB of the card and run binary diff on the good and bad 
card ? That way you'll see what changed.

M


More information about the U-Boot mailing list