[U-Boot-Users] reading environment from flash fails

Wolfgang Denk wd at denx.de
Mon Dec 1 19:02:17 CET 2003


Dear Wolter,

in message <3FCB7600.6040402 at wkamphuis.student.utwente.nl> you wrote:
>
> U-boot is located at 0xfff00000 up to 0xfff20000. I would like to save 
> my environment in the same sector as u-boot, but in the last two Kb's, 
> thus at 0xfff1f800-0xfff20000

Don't do this. This is by far too dangerous. Each "saveenv" will open
a window in time where your system will  not  recover  from  a  power
loss. DO NOT DO THIS.

> (0xfff00000 + 0x20000 - 0x800 = 0xfff1f800 = starting address for env)

This makes no sense. Never place the environment in any flash  sector
that contains any other data you need.

> Ok, now the problem is I don't know how to tell the linker where to 
> store the environment. If I add
> 
> . = env_offset;
> common/environment.o    (.text)
> 
> to the u-boot.lds I get "cannot move location counter backwards (from 
> fff07b10 to 0061f800)". Where does the 0061f800 comes from?

That's what was computed as env_offset given your definitions.

> Letting u-boot store its environment outside the u-boot sector 
> (<0xfff0000) works perfectly but will cost me a flash sector dedicated 
> for the environment. I rather do without since I realy need that space.

I'd rather have a reliably working system instead  of  one  which  is
broken by design just to save a flash sector.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Weekends were made for programming.                 - Karl Lehenbauer




More information about the U-Boot mailing list