From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Thu, 08 Apr 2010 12:04:19 +0200 Subject: [U-Boot] Getting "Unable to save the rest of sector (196608)" when I turn on Redundant env with CFG_ENV_ADDR_REDUND In-Reply-To: References: Message-ID: <20100408100419.629491051E73@gemini.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 Brian Hutchinson, In message you wrote: > > > #if CFG_ENV_SECT_SIZE > CFG_ENV_SIZE > > up_data = (end_addr_new + 1 - ((long)flash_addr_new + CFG_ENV_SIZE)); > > debug ("Data to save 0x%x\n", up_data); > > if (up_data) { > > if ((saved_data = malloc(up_data)) => = NULL) { > > printf("Unable to save the> rest of sector (%ld)\n", > > up_data); > > goto Done; > > } > > memcpy(saved_data, > > (void *)((long)flash_addr_> new + CFG_ENV_SIZE), up_data); > > debug ("Data (start 0x%x, len 0x%x) saved > at 0x%x\n", > > (long)flash_addr_new > + CFG_ENV_SIZE, > > up_data, s> aved_data); > > } > > #endif > > > > ... which to my understanding is intended to allow you to save RAM by > > using a env. smaller than your sector size which is my case. This has nothing to do with saving RAM. The thing is that with CFG_ENV_SECT_SIZE > CFG_ENV_SIZE, there might be important data in the part of the sector that is not occupied by the environment, so we must save and restore this content. > > I've also tried to set CFG_ENV_SIZE to be the flash sector size which > > gets me over the above "Unable to save the rest of sector" problem but > > I suspect that I'm having RAM issues as I only have 128M RAM and am 128 MB of RAM is an awful lot. > > trying to use two environments of 256k each and the problem I'm having > > then becomes when I try to nfs boot my board .... it just hangs. Two copies of 256 kB each gives just a 0.4% of the available RAM - I don't understand why you think this might be a critical amount. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "There are things that are so serious that you can only joke about them" - Heisenberg