From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Wed, 15 Sep 2010 13:15:14 -0500 Subject: [U-Boot] Davinci DM365 custom design : Problem when reading uBoot environment variables In-Reply-To: <1918F436C366B34BB245DD28389E039453ADFAAD1E@mars.easii.fr> References: <1918F436C366B34BB245DD28389E039453ADFAAD1E@mars.easii.fr> Message-ID: <20100915131514.7792c2ea@schlenkerla.am.freescale.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 15 Sep 2010 18:21:11 +0200 Reda MIMOUNE wrote: > But when I reset the board, the message is *** Warning bad CRC or NAND. the zone was set to a NAND block size of 128KB (since it is mandatory to be the same size). > I put some debug messages to find out that the read_env function used returns an error because of my environment variables block is bad. This i cannot understand since it wrote data in the right block. If the block is bad, then that's not the right block. :-) You can use CONFIG_ENV_RANGE to declare a multi-block range, larger than the environment size, to allow bad blocks to be skipped. Or you can use the new env.oob feature to dynamically mark a known-good block as your environment. > To widen the problem I choose to double the environment size to 256KB. It is still the same. You need to use CONFIG_ENV_RANGE and keep the environment the same size -- otherwise it thinks you really want two blocks of environment data, and one of those blocks being bad is still fatal. > I typed the "nand bad " at prompt and my blocks + the bad block tables were marked as bad ! is that normal that BBT are marked bad ? Yes, the BBT blocks are marked bad so they won't be used for other purposes. > So for the moment i try to remove this bad character from my block by trying to erase all the nand, and using nand scrub. Please be careful with that. Unless you have reason to believe that the block was accidentally marked bad by something software did, you ought to leave bad block markers in place. The manufacturer put that marker there to indicate that the block is unreliable (it's normal for NAND flash to contain a few such blocks). -Scott