From: Wolfgang Denk Date: Fri, 28 Nov 2003 19:42:02 +0100 Subject: [U-Boot-Users] reading environment from flash fails In-Reply-To: Your message of "Fri, 28 Nov 2003 18:04:43 +0100." <3FC7802B.7010506@wkamphuis.student.utwente.nl> Message-ID: <20031128184207.E0B39C5F5F@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 In message <3FC7802B.7010506@wkamphuis.student.utwente.nl> you wrote: > > We define: > #define CFG_MONITOR_BASE 0xFFF00000 > #define CFG_ENV_SECT_SIZE (128*1024) > #define CFG_ENV_SIZE (2*1024) > #define CFG_ENV_ADDR (CFG_MONITOR_BASE + CFG_ENV_SECT_SIZE - CFG_ENV_SIZE) The CFG_ENV_ADDR definition makes no sense to me. If it results in the intended value than by pure chance, not by any deeper logic. > Memory location fff1f800 contains nothing, but after a 'saveenv' my > environment is saved there. Memory location fff08174 contains my default > environment and is unchanged after a 'saveenv'. Sounds good to me... > Shouldn't gd->env_addr be equal to CFG_ENV_ADDR? Now my saved > environment settings aren't read and after a reset all settings are > restored to the defaults. > > The original patch, my unfinished patch and some screendumps are > available on my website: > http://wkamphuis.student.utwente.nl/u-boot/ I don't know which board you're talking about, and I don't understand how your patch and your question are related to each other. From this message it sounds as if you want to put the environment in flash, but your code #defines CFG_ENV_IS_IN_NVRAM (at least in some cases). No big surprise you run into problems? Just a remark: Please note that many lists in U-Boot (board names etc. in Makefile, README, MAKEALL, ...) are SORTED. I will reject a patch that breaks this (read: please fix your code). Also, I will insist in properly formatted source code. See the Linux "CodingStyle" for details. > Could someone give me a tip pointer where to look for a solution? I have > a feeling it has something to do with the u-boot.lds file but I don't > know what. Of course the linker script must match your flash layout. 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 While money can't buy happiness, it certainly lets you choose your own form of misery.