Skip to contentSkip to conversation

NAND Bad Block Algorithm, JFFS2, and CRAMFS

DISCUSSION Richard Schmitt 2 participants 2 messages May 28, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

We are using JFFS2 on NAND devices and are currently running into a problem that I was hoping to get some guidance on.

We've created a 14MB partition. We've configured the NAND driver to - Verify Writes
- Enable ECC
- Disable Bad Block Checking

We've disabled Bad Block checking because as we understand it, this must be disabled in order to support JFFS2. I have a question on this that I'll raise a bit further on.

We can copy a 64K jffs2 image onto the flash and mount it without problem.
When we try to copy a 7MB image onto the flash, the copy will fail with a
generic 'input/output error'.

Our hypothesis is that there is a bad block somewhere in the flash that is not hit with the 64K image but is hit with the 7MB image. Because of this and with Verify Writes enabled, the copy will fail.

This brings us back to the question introduced earlier. If we need to disable bad block checking with NAND in order to support JFFS2, then how do we copy a JFFS2 image onto the flash if the flash has a bad block in it?

The second piece of this question is that we really wanted to support two partitions, one with a JFFS2, and another with CRAMFS. We wanted to run with the bad block algorithm on CRAMFS and without it on the JFFS2 one. We've heard rummblings that this is not supported. Is that true or is there some way that we can get that to work.

Rich

Signature · 6 lines
Richard Schmitt
CTO
Blue Peach Solutions
Phone: 877.BLU.PEACH (877.258-7322) x 704
Fax: 508.302.6183
http://www.bluepeach.com
#1 lore raw
Quoted 7 lines · Richard Schmitt

We are using JFFS2 on NAND devices and are currently running into a problem that I was hoping to get some guidance on.

We've created a 14MB partition. We've configured the NAND driver to - Verify Writes
- Enable ECC
- Disable Bad Block Checking

Which version of NAND are you using ? Where do you disable bad block checking
- in nand_erase I assume ?

Quoted 3 lines

We've disabled Bad Block checking because as we understand it, this must be disabled in order to support JFFS2. I have a question on this that I'll raise a bit further on.

Why so ?

Quoted 3 lines

We can copy a 64K jffs2 image onto the flash and mount it without problem.
When we try to copy a 7MB image onto the flash, the copy will fail with a
generic 'input/output error'.

You _CANNOT_ copy with cp xyz /dev/mtdx, therefor we have mtdutils, nandwrite is your friend, buit it relies on the intact bad block information.

Quoted 3 lines

Our hypothesis is that there is a bad block somewhere in the flash that is not hit with the 64K image but is hit with the 7MB image. Because of this and with Verify Writes enabled, the copy will fail.

By disabling the bad block check in erase you have managed to destroy the bad block info. Hopefully you remember which blocks were bad so you can try to mark them as bad again.

Quoted 4 lines

This brings us back to the question introduced earlier. If we need to disable bad block checking with NAND in order to support JFFS2, then how do we copy a JFFS2 image onto the flash if the flash has a bad block in it?

Who said that ?

Quoted 5 lines

The second piece of this question is that we really wanted to support two partitions, one with a JFFS2, and another with CRAMFS. We wanted to run with the bad block algorithm on CRAMFS and without it on the JFFS2 one. We've heard rummblings that this is not supported. Is that true or is there some way that we can get that to work.

Trusting rumblings is almost not a good idea.

There are some efforts to make CRAMFS work on top of NAND with respect to bad blocks. Other efforts are on the way to provide a SSFDC compatible glue layer.
The recent changes in NAND provide extended bad block support including flash based bad block tables. I really have no clue where this information comes from.

Signature · 9 lines
Thomas
________________________________________________________________________
Steve Ballmer quotes the statistic that IT pros spend 70 percent of their 
time managing existing systems. That couldn’t have anything to do with 
the fact that 99 percent of these systems run Windows, could it?
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: [email protected]