[Yaffs] Re: Bad eraseblock

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Wookey
Date:  
To: yaffs
Subject: [Yaffs] Re: Bad eraseblock
+++ wang dengyi [05-06-06 10:58 -0700]:
> Hello,
>
> My embedded system is AT91RM9200(arm9) with linux
> 2.6.11.10. My NAND flash is Toshiba TC58DVG02A1FT00.
>
> The flash has 8192 blocks. When linux boots, it
> reports that the first 2105 blocks are "Bad
> eraseblock". What does it mean?


It probably means something has gone wrong :-)

In simple terms it means this block appears to be marked bad in the OOB.
Assuming that these blocks aren't _really_ bad (there should be no more than
5% bad to start with) the problem is likely to be a confusion between
different bit of software over which mapping is used for ECC bytes. There
are various arrangements that can be used for these bytes. If one bit of
software (or hardware) is writing one arrangement, and another is expecting
another arrangement, then every changed block can come out 'apparently bad'.

e.g if the bootloader is writing images with a different layout to yaffs in
the filesystem, or hardware ecc is present but yaffs has been compiled for
soft ecc (with a different layout) or jffs2 and yaffs are both being used
but with different layouts. All of these will screw up your flash.

It may have been that whilst getting used to yaffs you booted with some
other scheme once before getting the settings how they are now - same effect
is possible, under some circumstances.

To fix it you just have to completely erase the flash, including the
bad-block markers. This normally gives you all your flash back, although
there is a small risk that it will screw it up if the factory-marked bad
blocks take offense at being re-used - I don't think anyone has seen this
problem in practice.

The MTDutils will help you with the erasing. I'm not sure if anyone has
actually hacked a tool foris job yet or if you have to mess with nandwrite
so that it will let you nobble the bad blocks.

Of course it could be some other problem, but mismatched ECC is the most
usual cause of this sort of thing.

Wookey
-- 
Aleph One Ltd, Bottisham, CAMBRIDGE, CB5 9BA, UK  Tel +44 (0) 1223 811679
work: http://www.aleph1.co.uk/     play: http://www.chaos.org.uk/~wookey/