[Yaffs1] mkyaffs exits with "MTD Erase failure"

Ricard Wanderlof ricard.wanderlof at axis.com
Mon Jun 4 11:12:40 EDT 2007


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

>>> 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.
>
> But as you see, flash_eraseall on the same device works perfectly fine:
>
> flash_eraseall /dev/mtd0
> ....
> Skipping bad block at 0x0179c000
> Erasing 16 Kibyte @ 1ffc000 -- 99 % complete.

flash_eraseall skips bad blocks while erasing. I don't know how mkyaffs 
works though.

>> 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.
>
> I have a kernel with this patch, yes - and it does work. However, then I 
> remove the factory-marked ones, as well. Not a good idea!

You can always re-mark the factory bad ones, given that you have written 
down which they were once... if you are using a flash-based BBT, erasing 
the BBT blocks would suffice, as the bad block management in jffs2 when 
using a flash-based BBT doesn't touch bad block markers. I would assume 
from your reasoning that you are not using a flash-based BBT?

In a lab environment, erasing the factory-marked bad blocks will probably 
work well enough not to cause a hassle, as long as you don't use the flash 
for long-term storage.

/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