Problems with getting a nand-flash chip to work

Håkan Kvist hagar at df.lth.se
Mon Feb 20 10:38:57 EST 2006


On Fri, Feb 17, 2006 at 04:25:25PM +0100, Håkan Kvist wrote:
> On Fri, Feb 17, 2006 at 10:44:03AM +0100, Håkan Kvist wrote:

[..]

> I belive that I forget to mention that the chip that we are currently 
> using is the 512 Mbit chip from STMicroelectronics.
> 
> I also have tested the to write directly to the nand with the 
> mtd_debug utility.
> 
> I've filled the first 4 blocks (65535 bytes) with data, and I can read
> it back successfully and verify that it is identical to what I wrote.
> 
> What is the next thing I should look into?

Now I have erased the flash with "flash_eraseall -j /dev/mtdx",
then the nanddump utility was used to dump the contens of the flash to
a file.

According to the documentation on the linux-mtd homepage the first
oob-area of every page should look like this 
(03 20 is ERASEBLOCK_CLEANMARKER):

          xx xx xx xx xx xx xx xx  85 19 03 20 08 00 00 00

and what I got is (05 20 is ERASEBLOCK_HEADER)
         
          xx xx xx xx xx xx xx xx  85 19 05 20 18 00 00 00

Is that correct?

The state of the flash after a flash_erasell -j, should be a
filesystem that can be mounted directly, without doing any erasing,
right?

As the result from doing mtd_eraseall isn't cleanmarker blocks it is
perhpahs not so strange that mount complains about that 
cleanmarker nodes aren't to be found.

And as posted before, I get the following when running
  mount -t JFFS2 /dev/mtdX /mnt

========== Output from mount (just the last rows)
mtd->read(0x400 bytes from 0x3fec000) returned ECC error
nand_read_oob: from = 0x03fec000, len = 64
nand_isbad_bbt(): bbt info for offs 0x03ff0000: (block 4092) 0x00
nand_read_oob: from = 0x03ff0000, len = 48
jffs2_check_nand_cleanmarker_ebh(): Cleanmarker node not 
detected in block at 03ff0000
nand_read_ecc: from = 0x03ff0000, len = 1024
nand_read_ecc: Failed ECC read, page 0x0001ff80
mtd->read(0x400 bytes from 0x3ff0000) returned ECC error
nand_read_oob: from = 0x03ff0000, len = 64
JFFS2: Erase block at 0x03ff0000 is not formatted. It will be erased
nand_isbad_bbt(): bbt info for offs 0x03ff4000: (block 4093) 0x00
nand_read_oob: from = 0x03ff4000, len = 48
jffs2_check_nand_cleanmarker_ebh(): Cleanmarker node not detected 
in block at 03ff4000
nand_read_ecc: from = 0x03ff4000, len = 1024
nand_read_ecc: Failed ECC read, page 0x0001ffa0
nand_read_ecc: Failed ECC read, page 0x0001ffa1
mtd->read(0x400 bytes from 0x3ff4000) returned ECC error
nand_read_oob: from = 0x03ff4000, len = 64
JFFS2: Erase block at 0x03ff4000 is not formatted. It will be erased
nand_isbad_bbt(): bbt info for offs 0x03ff8000: (block 4094) 0x00
nand_read_oob: from = 0x03ff8000, len = 48
nand_read_ecc: from = 0x03ff8000, len = 1024
nand_read_ecc: Failed ECC read, page 0x0001ffc0
mtd->read(0x400 bytes from 0x3ff8000) returned ECC error
nand_read_oob: from = 0x03ff8000, len = 64
nand_isbad_bbt(): bbt info for offs 0x03ffc000: (block 4095) 0x00
nand_read_oob: from = 0x03ffc000, len = 48
nand_read_ecc: from = 0x03ffc000, len = 1024
nand_read_ecc: Failed ECC read, page 0x0001ffe0
nand_read_ecc: Failed ECC read, page 0x0001ffe1
mtd->read(0x400 bytes from 0x3ffc000) returned ECC error
nand_read_oob: from = 0x03ffc000, len = 64
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 1, c->nr_blocks 4096
mount: Mounting /dev/mtdblock1 on /mnt/flash failed: Input/output error


========== Output from hexdump|tail -20
00000000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
*
00000200  ff ff ff ff ff ff ff ff  85 19 05 20 18 00 00 00
00000210  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
*
00000410  ff ff ff ff ff ff ff ff  64 93 3c ed 00 00 00 00
00000420  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
*
00000620  ff ff ff ff ff ff ff ff  00 00 00 00 00 00 00 00
00000630  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
*
00004400  ff ff ff ff ff ff ff ff  85 19 05 20 18 00 00 00
00004410  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
*
00004610  ff ff ff ff ff ff ff ff  64 93 3c ed 00 00 00 00
00004620  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
*
00004820  ff ff ff ff ff ff ff ff  00 00 00 00 00 00 00 00
00004830  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff



best regards
Håkan




More information about the linux-mtd mailing list