[Yaffs] ECC error with ECC turned off

Charles Manning manningc2@actrix.gen.nz
Wed, 13 Oct 2004 09:48:56 +1300


On Tuesday 12 October 2004 21:54, Daniel Gustafsson wrote:
> When I run yaffs/direct and create, write, closes a file I always get a=
n
> ECC error (**>>eec error fix performed on chunk XXX; Block 1 marked for
> retirement) regardless if I have the ECC turned off. Why???

What do you mean by "ECC turned off"?

In YAFFS you can say "USE NAND ECC" which means that YAFFS assumes the NA=
ND=20
does (or the mtd driver) does its own ECC andYAFFS does not have to.=20

Otherwise, YAFFS does its own ECC calculations and will give you these er=
rors=20
if the ECC does not work.

If you're using YAFFS in a situation where you don't want ECC then say "U=
SE=20
NAND ECC" which means that YAFFS won't do the ECC.

>
> How does the reserved blocks in the device work? Which blocks are reser=
ved?
> Some simple explanation how the reserved and startblock work would be n=
ice.

You cannot use block 0 of a NAND device.
the start block is the first block of the device available to YAFFS.
The endBlock is the last block available to YAFFS.

Typically you'd use startBlock=3D1 and enbBlock =3D devices_size_in-block=
 -1, but=20
frequently people do things like running two yaffs partitions by doing

partiton 0
start=3D1
end=3Dn

partion 1
start =3D n+1
end =3D size -1


The ReservedBlocks does not reserve any particular blocks. What it says i=
s=20
that yaffs should reserve this number of blocks. The reserved space serve=
s=20
three purposes:
* it keeps some blocks as backup in case blocks fail.
* it keeps space spare to handle inflight cached data.
* it keeps spare space for garbage collection.

YAFFS will not mount with less than 2 reserved free. How many you want to=
=20
have depends on the degree of robustness you want against serial block=20
failures. As a guideline 5 to 10 should be enough.

Hope that helps

-- Charles