2008-03-04 06:39:14     Big problem with bads block of Nand flash

Document created by Aaronwu Employee on Sep 18, 2013
Version 1Show Document
  • View in full screen mode

2008-03-04 06:39:14     Big problem with bads block of Nand flash

Cyril HAENEL (FRANCE)

Message: 52020    Hi all,

 

My uImage is stored in Nand Flash. To boot on it in u-boot I use the "nboot 1000000 0 0" command.

To program my uImage in the flash under uclinux, I do :

 

eraseall /dev/mtd0

nandwrite -p -b1 /dev/mtd0 uImage

 

Until now, everything was OK.

But a bad erase block appeared in the flash and now I can't boot anymore.

 

Thus the only solution is to have a filesystem in the flash. But I read on the u-boot documentation that u-boot can read a file from a filesystem !?

 

How can I do ? :((

 

Regards,

Cyril

TranslateQuoteReplyEditDelete

 

 

2008-03-04 08:25:24     Re: Big problem with bads block of Nand flash

Mike Frysinger (UNITED STATES)

Message: 52021    the file in u-boot/doc/README.nand covers the nand functions

 

note that when it says things like "read.jffs2" and "write.jffs2", it isnt restricted to jffs2 ... it just means it does badblock handling

QuoteReplyEditDelete

 

 

2008-03-04 10:18:38     Re: Big problem with bads block of Nand flash

Cyril HAENEL (FRANCE)

Message: 52031    Ok.....

 

So the easiest way for me is to modify the nandwrite version I use to just skip bad block and continue the write in the next block.

Normally nand read.jff2 will skip the bad block too I still have a complete file without read error.

 

I try this now !

 

Regards,

Cyril

TranslateQuoteReplyEditDelete

 

 

2008-03-04 12:35:08     Re: Big problem with bads block of Nand flash

Cyril HAENEL (FRANCE)

Message: 52043    Ok, no need to modify nandwrite : it automatically skips bads block and continues its job.

 

And under u-boot, the nand read.jffs2 skip bad block during read, and continue it's job.

 

So it seem's to be OK, now I am able to boot on the flash containing bad erase blocks.

 

But I have a question :

 

Before, I used the nboot 1000000 0 xxx command, and I think this command read only the good number of byte to get the entire image, and no more.

 

But now, to boot with the read.jffs2 option, I have 2 commands line to do at boot :

nand read.jffs2 1000000 ADDRESS SIZE

bootm 1000000

 

But because I don't know the image size, do I must read the entire chip without specify the size parameter ?

On some product I can do that because the boot time is not important, but on another (the car computer for example), the boot must be a fast as possible, and it will be great to only read the number of byte of the image but no more !

 

Is a solution exists for this problem ?

 

Regards,

Cyril

TranslateQuoteReplyEditDelete

 

 

2008-03-04 13:13:07     Re: Big problem with bads block of Nand flash

Mike Frysinger (UNITED STATES)

Message: 52046    there is currently no way to do what you want, but this patch should add the features you're after:

http://blackfin.uclinux.org/gf/project/u-boot/tracker/?action=TrackerItemEdit&tracker_item_id=3509

QuoteReplyEditDelete

 

 

2008-03-05 03:32:58     Re: Big problem with bads block of Nand flash

Cyril HAENEL (FRANCE)

Message: 52070    Great !

It's exactly what I wanted to do today : modify the nboot command to skip bads block and works as read.jffs2 !

TranslateQuoteReplyEditDelete

 

 

2008-10-31 07:48:15     Re: Big problem with bads block of Nand flash

Christophe Crepin (FRANCE)

Message: 64523   

 

Hi ,

 

I  have a problem to update the kernel image on linux .

 

when:

 

               eraseall /dev/mtd0

 

              cp linux /dev/mtd0 or nandwrite /dev/mtd0 linux 0

 

but i have everytime the same error :nand_write: Attempt to write not page aligned data .

 

I see that you use several option for nandwrite, when i looking at my nandwrite i don't use this option, I suppose that we not use the same where i can fin your version of nandwrite(mtd_utils) ? .

 

my hardware configuration :

 

Linux version 2.6.22.18-ADI-2008R1-svn (crepinc@crepinc-desktop) (gcc version 4.1.2 (ADI svn))

 

Blackfin support (C) 2004-2007 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.3

 

JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.block2mtd: version $Revision: 3544 $

NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)

 

Creating 2 MTD partitions on "NAND 256MiB 3,3V 8-bit":

0x00000000-0x01400000 : "linux kernel"

mtd: Giving out device 0 to linux kernel

0x01400000-0x10000000 : "file system"

mtd: Giving out device 1 to file system.

 

If it's not the good solution , Can you give my a anather solution to update the kernel image from linux ?

 

Ps: I try the solution on u-boot with fsload but it doesn't work on the flash nand .

 

thanks

 

christophe

 

 

 

 

TranslateQuoteReplyEditDelete

 

 

2008-10-31 14:26:24     Re: Big problem with bads block of Nand flash

Robin Getz (UNITED STATES)

Message: 64548   

 

Christophe:

 

new issue == new thread. Please don't re-start old threads with unrelated topics.

Attachments

    Outcomes