[Yaffs1] mkyaffs exits with "MTD Erase failure"

Ricard Wanderlof ricard.wanderlof at axis.com
Mon Jun 4 09:58:01 EDT 2007


On Mon, 4 Jun 2007, Martin Egholm Nielsen wrote:

> I have run into a problem: By "accident", we changed the die of our NAND
>  without paying attention to the new timing parameters.
> Hence, the read-operation (with fixed timing!) reported ready before
> data was actually ready on the NAND. Consequently, this caused checksum
> errors, and several blocks was erroneously marked bad!
>
> So, I fixed the timing in the kernel and tried erasing the flash again.
> But with no luck - mkyaffs refuses to erase/program the flash:

Mtd refuses to erase blocks that have been marked bad. There is no 
workaround on a running kernel, but it is possible to patch the kernel to
do this.

The patch depends on whether or not you have a flash-based bad block 
table. Most do, but my only experience has been without the flash-based 
BBT. In this case, you simply remove the if clause around 
nand_block_checkbad() in mtd/nand/nand_base:nand_erase_nand(), recompile, 
and use that kernel to erase the blocks that have accidentally been marked 
bad.

If you're using a flash-based BBT you need to fiddle with the table to 
unmark the bad blocks. Probably not too difficult, but I've never done 
that myself. AFAIK, mtd doesn't mark the actual blocks as bad, so you 
don't need to erase the bad block markers in the offending blocks in this 
case, only clear the blocks in the BBT.

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30




More information about the linux-mtd mailing list