Missing flash block when using EFFS-STD

Discussion to talk about software related topics only.
cbyrne
Posts: 23
Joined: Thu Jun 10, 2010 1:30 pm

Missing flash block when using EFFS-STD

Post 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
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Missing flash block when using EFFS-STD

Post 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?
cbyrne
Posts: 23
Joined: Thu Jun 10, 2010 1:30 pm

Re: Missing flash block when using EFFS-STD

Post by cbyrne »

I believe that's what the two descriptor blocks are for. There is still one block unaccounted for.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Missing flash block when using EFFS-STD

Post by rnixon »

I don't think that is correct. Where did you see this?
cbyrne
Posts: 23
Joined: Thu Jun 10, 2010 1:30 pm

Re: Missing flash block when using EFFS-STD

Post 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.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Missing flash block when using EFFS-STD

Post 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.
cbyrne
Posts: 23
Joined: Thu Jun 10, 2010 1:30 pm

Re: Missing flash block when using EFFS-STD

Post 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.
User avatar
pbreed
Posts: 1087
Joined: Thu Apr 24, 2008 3:58 pm

Re: Missing flash block when using EFFS-STD

Post 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
cbyrne
Posts: 23
Joined: Thu Jun 10, 2010 1:30 pm

Re: Missing flash block when using EFFS-STD

Post 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.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Missing flash block when using EFFS-STD

Post 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.
Post Reply