This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: RE : JFFS2 for NAND flash file system


* Paul MAILLET <paulmaillet37@gmail.com> wrote:
> As my target use NAND
> flash and JFFS2 doesn't support it, I would like to know if it is
> really problematic or dangerous or anything that I should be aware of
> when using it on NAND flash device.

Running a non-NAND-aware filesystem on NAND is a very bad idea.

On NAND parts it is mandatory to implement an error correcting code (ECC),
either in software, or in hardware if your board's memory controller
supports it. Any given NAND part's datasheet should contain details
of the recommended minimum protection level to use for that chip. It is
traditional to store the computed ECC in each page's out-of-band ("spare")
area and check it on read. Without an ECC, you will get no warning of the
occasional random bitflips which occur in the data returned from the chip.

Even reading a NAND page can, once in a while, cause a bit in-flash to
flip (the "read disturb" effect). If your filesystem doesn't periodically
refresh its contents, files and/or filesystem metadata which is frequently
read but never changed will gradually rot.

NAND flash, like NOR, gradually wears out over time. However, a NAND
driver author is expected to notice when blocks fail to write correctly
(many chips will tell you when they have failed to write) and devise a
method of putting such blocks beyond use. If you don't do this, you will
experience long-term reliability issues.

There may also be a small number of eraseblocks declared to be bad during
factory testing. This is done by setting a marker in the OOB area;
again, check the datasheet for details. A correct NAND implementation
will avoid such blocks; if you were to write to one, the chip's behaviour
is undefined.


In summary, you cannot safely run any filesystem on NAND parts unless
it has been specifically designed or modified for the peculiarities of
NAND flash. I cannot state this strongly enough.


Now, the public JFFS2 tree has had support for NAND flash since 2003.
It looks like the version in eCos dates from around that time, though
has its NAND support disabled; there's an argument to be made that this
perhaps ought to be put right some time.


Regards,

Ross

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]