Page 1 of 2

Missing flash block when using EFFS-STD

Posted: Wed Sep 15, 2010 8:57 am
by cbyrne
I am trying to account for a missing block when using an on-chip flash file system.

On a MOD5234 with the 2MB AM29LV160B flash chip, I set up a 512k file system following the example project. The call to fs_getfreespace comes up short by one 64k block. The comment and defines in AM29LV160B.c show two 64k descriptor blocks, leaving six blocks for file system data. However, this api is reporting 327,680 total bytes (five 64k blocks) with no bad blocks. Six blocks would be 393,216. Where is the missing block?

-Chuck

Re: Missing flash block when using EFFS-STD

Posted: Wed Sep 15, 2010 9:31 am
by rnixon
If you have a flash chip with sectors, and flash can only be written in bytes, erased in sectors, how does the file system manage the files and erasures unless it has an extra sector to do so?

Re: Missing flash block when using EFFS-STD

Posted: Wed Sep 15, 2010 11:32 am
by cbyrne
I believe that's what the two descriptor blocks are for. There is still one block unaccounted for.

Re: Missing flash block when using EFFS-STD

Posted: Wed Sep 15, 2010 2:32 pm
by rnixon
I don't think that is correct. Where did you see this?

Re: Missing flash block when using EFFS-STD

Posted: Wed Sep 15, 2010 3:11 pm
by cbyrne
This project: C:\nburn\examples\MOD5234\MOD5234-EFFS-STD

Look at the comment in AM29LV160B.c. The same text appears in the document "EFFS-ProgrammersGuide.pdf". The entire memory map of the 2Mb flash is laid out. To quote:

* Descriptor Blocks:
* These blocks contain critical information about the file system, block allocation,
* wear information and file/directory information

Clearly these blocks are used for management of the file system blocks. There is more information on Descriptor blocks in the "HCC-Embeddedd, Embedded Flash File System Implementation Guide, version 1.84" (EFFS-STD-R1p84.pdf). See "Files and Blocks" and "Sectors and File Storage" for example.

Re: Missing flash block when using EFFS-STD

Posted: Wed Sep 15, 2010 4:06 pm
by rnixon
My interpretation of that texts is that the descriptor blocks contain file system information, not file system data. There are 2 of them because you need to be able to erase one entire block. Management is different than data.

You need an extra file data sector for the same reason. Somewhere to copy data while a sector is erased.

Re: Missing flash block when using EFFS-STD

Posted: Wed Sep 15, 2010 5:56 pm
by cbyrne
Where is that extra file sector located (what address)? Where is it documented?

My question was about a missing block, not a sector.

Re: Missing flash block when using EFFS-STD

Posted: Fri Sep 17, 2010 2:35 pm
by pbreed
The Extra data block would jump around as different sectors get used and erased.
So I don't believe its in a fixed location, I think the system manages this.

Paul

Re: Missing flash block when using EFFS-STD

Posted: Mon Sep 20, 2010 7:29 am
by cbyrne
That makes three 64K blocks of overhead to get a functional file system. I currently only need less than 64K of storage, which will use 256K of flash. There is plenty of RAM for the driver to manage erasing/writing these blocks without needing extra blocks, but I guess that's the cost of the power fail-safe feature. It seems like it could be done with two blocks but there appears to be no way to configure it. The 8K user parameter area is too small for my application.

Re: Missing flash block when using EFFS-STD

Posted: Mon Sep 20, 2010 8:59 am
by rnixon
Have you seen the app note on the tech docs page for configuring the user param area to a bigger block? That way you could use a 64k block. Its for a mod5282, but you can probably port it.
http://www.netburner.com/downloads/ndk/ ... torage.pdf
I would have suggested this before but it wasn't clear what your storage needs were.