From: Wolfgang Denk Date: Mon, 01 Dec 2003 19:02:17 +0100 Subject: [U-Boot-Users] reading environment from flash fails In-Reply-To: Your message of "Mon, 01 Dec 2003 18:10:24 +0100." <3FCB7600.6040402@wkamphuis.student.utwente.nl> Message-ID: <20031201180222.972BDC5F5F@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolter, in message <3FCB7600.6040402@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