[ECOS] JFFS2 Access and interrupts

Gernot Zankl zankl@decomsys.com
Fri Sep 8 10:00:00 GMT 2006


Hi all !

> A basic rule of working with flash is that if any code is erasing or
> programming part of the flash then no other code can access it. Some
> flash chips relax that restriction somewhat by providing several
> banks, but at best that is only a partial solution. Flash accesses can
> come from a variety of sources.

I'm using ROMRAM versin of redboot and the applications runs in RAM,
too.
Are there any calls to the ROM version of the redboot during the
execution
of a "normal" application, which would cause reading access to the flash
?

>   3) some other thread may access the flash for some other reason,
>      either via the flash API or directly. Especially if the
>      application itself resides in flash.

The application is (currently) loaded from the tftp server and is
executed in
RAM. There exists just one jffs2 partition and it's the only one
mounted.

> Anoncvs also has a V2 flash development branch which addresses some of
> the problems. In particular it adds mutex locking for accessing flash
> devices, so if the only other flash accesses happen via the V2 flash
> API then you'll be ok. Again a ROMRAM RedBoot would be a very good
> idea.

I want to give the v2 version a try. As far as i've seen, there exists a
flas_v2 branch in the CVS.
Are the modules devs/flash, io/flash and fs/jffs2 the only ones, I've to
upgrade ?

I built a test application (heavily based on one of the jffs2 tests),
where
cyclically files (with size f) are allocated, filed with rand()-values, 
crc-checked and finally erased. 
Starting with a fresh partition (all filled with 0xff) of size S, 
it seems that after a number of iterations i, jffs2 produces a lot of
warnings
(see below), where always approx. i * f = S.
The test continues, but most of the time hangs some iterations later.

><INFO> Iteration 0000058: passed=0000058, failed=0000000
><5>JFFS2 notice:  read_unknown: node header CRC failed at %#08x. But it
must have been OK earlier.
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00001034)
><4>JFFS2 warning:  jffs2_do_read_inode_internal: no data nodes found
for ino #60
>jffs2_read_inode() failed
>jffs2_iget() failed for ino #60
><ERROR>: open() returned -1 I/O error
><ERROR>: read() returned -1 Bad file handle
>File <test0000058> is corrupt<ERROR>: read() returned -1 Bad file
handle
><4>JFFS2 warning:  jffs2_get_inode_nodes: no valid nodes for ino #60
><4>JFFS2 warning:  jffs2_do_read_inode_internal: no data nodes found
for ino #60
>jffs2_read_inode() failed
>jffs2_iget() failed for ino #60
><ERROR>: unlink() returned -1 I/O error
><4>Node CRC ffffffff != calculated CRC f09e7845 for node at 0003f610
><ERROR>: read() returned 3
>File <test0000059> is corrupt<INFO> Iteration 0000059: passed=0000058,
failed=0000007
><5>JFFS2 notice:  read_unknown: node header CRC failed at %#08x. But it
must have been OK earlier.
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x000009f0)
>File <test0000059> is corrupt<4>Node totlen on flash (0xffffffff) !=
totlen from node ref (0x00000034)
><INFO> Iteration 0000060: passed=0000058, failed=0000008

Inbetween the aplication also produces:

><INFO> Iteration 0000207: passed=0000201, failed=0000024
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00000034)
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00000034)
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00000034)
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00000034)
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00000034)
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00000034)
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00000034)
><4>Node totlen on flash (0xffffffff) != totlen from node ref
(0x00000034)
><INFO> Iteration 0000208: passed=0000202, failed=0000024

Regards,
Gernot Zankl


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



More information about the Ecos-discuss mailing list