From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Barada Date: Thu, 26 Apr 2012 13:11:19 -0400 Subject: [U-Boot] Can't read kernel if bad blocks are present in partition In-Reply-To: <4F99313F.1020800@ftemaximal.fr> References: <4F99313F.1020800@ftemaximal.fr> Message-ID: <4F9981B7.6000000@logicpd.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/26/2012 07:27 AM, Alexandre Gambier wrote: > Hi, > > I'm working on a STM chip under linux and U-Boot 1.3.1. > > Here's my problem. > To boot linux up I load the kernel stored in a NAND device. If a bad > block is present in the nand I can't load the kernel. > > To store the kernel I first erase the partition and write the kernel image. > During the erase stage, U-Boottells that a bad block has been skipped > but everything's fine. > > NAND erase: device 0 offset 0x520000, size 0x400000 > Skipping bad block at 0x005c0000 > Erasing at 0x900000 -- 100% complete. > OK > > When I write the kernel image, U-Boottells that everything's fine. > > NAND write: device 0 offset 0x520000, size 0x400000 > 4194304 bytes written: OK > > But when I try to read the kernel, it fails. > > NAND read: device 0 offset 0x520000, size 0x1a4bff > 1723391 bytes read: ERROR > > > I though U-Boot was able to handle bad block when reading back data.. > > Did I forget to initialize something ? > Did you use "nand write.i" to write the kernel and "nand read.i" to read the kernel? the ".i" tells u-boot to skip bad blocks... -- Peter Barada peter.barada at logicpd.com