[ECOS] JFFS2 write trouble

Joshua Boyd jdboyd@jdboyd.net
Tue Mar 30 17:04:00 GMT 2004

I'm running ecos 2.0 on a Hitachi SH3 platform with either 4 megabytes
of 16bit wide SDRAM and 2 megabytes of 8 bit wide AMD flash or 64megs of
32bit wide SDRAM and 4 megs of flash (two different boards), and I'm
having trouble with doing JFFS2 writes in a thread. 

I have the file system created and written to my flash chip.  My flash
chip isn't locked, I'm pretty darn certain.  I don't have to use fis
unlock commands before using fis to write to flash, and I don't have to
do anything special before writing directly to raw flash blocks (other
than erase the block, of course).

I precreated the files I want when I did my mkfs.jffs2, and I can read
those files using the read command in either cyg_user_start (assuming
I've mounted the file system then, of course) or in a thread.  However,
while I can write files in cyg_users_start, I can't properly write them
in a thread.  I'm trying to write 64bytes at a time, and I manage to get
a few writes in (say, 8 of them), then the board either resets or prints
something like:

I have tried using the mount function in cyg_user_start.  I have tried
using the mount function in my thread.  I have also tried statically
mounting using the MTAB_ENTRY macro (I'm inclined to stick with this,
since my flash is permenantly attached to the board, there is no reason
to mount and unmount it that I can think of).  None of those three mount
combinations makes a difference in how the write in a thread acts.

Also, I tried increasing the thread stack size from 8K to 1M.  Going
from 8K to 32K made it so that I could perform more than 1 write (of
64bytes), going to 64k let me do two writes, but going to 1 meg didn't
help any further.

I'm wondering if PAGE_CACHE_SIZE is large enough.  Looking at the output
of sh-elf-nm, I see that it is getting 4K, and further that if it
overwrote it's space it would be writing in places that could cause the
sorts of problems I'm seeing.  This is mainly conjecture on my part.
After a bit more digging online I will look up where in a CDL to change
that variable.

For the sake of testing, this program has only one thread.

What else might be important.  Uhm, I'm using the default 64k erase
blocks (which is correct for my flash chips, both of them), and the
default 4k page size.  I'm using 24k (11 permentant files, and 1 temp
file, all 2k in size) of space in a 1.3meg file system. 

I'm not sure what other information would be pertinent, so please ask.
I really need help.

I've been trying to run different search phrases through the
ecos-discuss archives, but I tend to find either people stuck on my more
in depth problems, or much simpler problems (like how to mount).

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