EmbeddedRelated.com
Forums

Flash file system

Started by Martin February 17, 2005
Looking for a small, light-weight Flash file system, preferably 8051 --C or 
ASM.  Interface to Flash is via SPI, not parallel.

It doesn't have to be free.

Thanks,

-Martin


Martin wrote:
> Looking for a small, light-weight Flash file system, preferably 8051
--C or
> ASM. Interface to Flash is via SPI, not parallel. > > It doesn't have to be free. > > Thanks, > > -Martin
The traditional way to do it is to layer a FAT filesystem over a flash translation layer. The translation layer works by having a table at the start of each erase unti that contains a table of all the logical blocks, e.g. if if erase unit 0 contains logical blocks 10 and 20, the table will contain 10 and 20 as the first two entries. When block 10 is written with new data, the first entry in the table will be set to all zeros and another table entry, possibly in another block will be set to 10. On a read, the FTL layer needs to invert this table - rather than having a mapping from physical blocks to logical blocks it needs to go from logical to physical. You can do this in two ways - either by having a lookup table big enough to hold the entire translation (at 16 or 32 bits per sector), or by having a smaller table act as a cache. Every now and again, you need to reclaim space by copying a full erase unit into a spare one skipping the 0 entries and uupdating the translation table as you go. You need to do this for two reasons, first that you can typically only erase units much larger than a sector (e.g. 64K vs 512 bytes), secondly that you need to make sure that the erase units at the start of the flash containing the FAT aren't worn out by being updated constantly. Wear levelling and reclaim algorithms are subtle, because a poor choice of algorithm will adversely affect the life expectancy of the flash chip. Some flash devices, like MMC and CF cards do this stuff internally and look like a device where you can read and write arbitrary data to sector sized blocks so you don't need the FTL layer, whereas others like SmartMedia or standalone SPI flash chips leave it up to you. FAT can scale from simple system, with just the root directory containing short filenames, up to a more complex one with subdirectories and long filenames. Ridgecrop could supply you one, cost depending on what feature you need and the details of the device. Tom Thornhill http://www.ridgecrop.demon.co.uk
"Martin" <0_0_0_0_@pacbell.net> wrote in message 
news:MK8Rd.929$DC6.256@newssvr14.news.prodigy.com...
> Looking for a small, light-weight Flash file system, preferably 8051 --C > or ASM. Interface to Flash is via SPI, not parallel. > > It doesn't have to be free. > > Thanks, > > -Martin
TFS is an open source File system, suitable for Flash devices. A very good article on TFS is at : http://www.embedded.com/2000/0012/0012ia2.htm Do a google to find the source. -Neo
Thanks for the suggestions.  I guess the problem here is the 8051.  Most of 
the FFS's I've found are written for 16 or 32 bit processors.

-Martin


"Neo" <timeless_illusion@yahoo.com> wrote in message 
news:380jufF5jlbluU1@individual.net...
> "Martin" <0_0_0_0_@pacbell.net> wrote in message > news:MK8Rd.929$DC6.256@newssvr14.news.prodigy.com... >> Looking for a small, light-weight Flash file system, preferably 8051 --C >> or ASM. Interface to Flash is via SPI, not parallel. >> >> It doesn't have to be free. >> >> Thanks, >> >> -Martin > > TFS is an open source File system, suitable for Flash devices. > A very good article on TFS is at : > http://www.embedded.com/2000/0012/0012ia2.htm > > Do a google to find the source. > -Neo > >
On Fri, 25 Feb 2005 23:36:16 GMT, Martin wrote:
> Thanks for the suggestions. I guess the problem here is the 8051. Most of > the FFS's I've found are written for 16 or 32 bit processors.
While not a flash filesystem take a look at Circuit Cellar, March 2005 (this months) ppgs 18 - 26, "Portable FAT Library for MCU Applications" by Ivan Sham, William Hue, & Pete Rizun. It uses the MSP430F449 but it still looks portable. -- Linux Home Automation Neil Cherry ncherry@comcast.net http://home.comcast.net/~ncherry/ (Text only) http://hcs.sourceforge.net/ (HCS II) http://linuxha.blogspot.com/ My HA Blog
Dear Martin:

We have developed a DOS FAT file system for SD/MMC flash memory cards
that
allows a microcontroller to read/write files in a way that mirrors
Unix.  The
code is written in C.  The flash card can then be inserted into a PC
card
reader and the files can be "double clicked" in Windows Explorer to
open and
modify.  You can read about the freeware version of our software:
"Portable FAT
Library for MCU Applications" Circuit Cellar, March 2005. 

We also have a commercial version that we license. We would be eager
to adapt it
to suit your needs and provide full support to ensure a successful
integration
into your product.  If you are interested, please do not hesitate to
contact
me.

Best regards,
Pete Rizun

Email: pete at rizun.com

Rizun wrote:
>
... snip ...
> open and > modify. You can read about the freeware version of our software: > "Portable FAT > Library for MCU Applications" Circuit Cellar, March 2005. > > We also have a commercial version that we license. We would be eager > to adapt it > to suit your needs and provide full support to ensure a successful > integration > into your product. If you are interested, please do not hesitate to > contact > me.
You would do much better with this sort of announcement if you paid even casual attention to the formatting of your article. This sort of thing doesn't engender any belief in the accuracy of your code. In fact, I would expect it to be extremely buggy. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson
On Wed, 02 Mar 2005 11:03:13 GMT, CBFalconer <cbfalconer@yahoo.com>
wrote:

>Rizun wrote: >> >... snip ... >> open and >> modify. You can read about the freeware version of our software: >> "Portable FAT >> Library for MCU Applications" Circuit Cellar, March 2005. >> >> We also have a commercial version that we license. We would be eager >> to adapt it >> to suit your needs and provide full support to ensure a successful >> integration >> into your product. If you are interested, please do not hesitate to >> contact >> me. > >You would do much better with this sort of announcement if you paid >even casual attention to the formatting of your article. This sort >of thing doesn't engender any belief in the accuracy of your code. >In fact, I would expect it to be extremely buggy.
It read fine here and the formatting was consistent Mr Smartypants. I wonder what your code quality is like? Mike
MSC <spam@spam.com> wrote in news:4mtb21p0mru4r17qfio9o8crqntqeujrco@
4ax.com:

> On Wed, 02 Mar 2005 11:03:13 GMT, CBFalconer <cbfalconer@yahoo.com> > wrote: > >>Rizun wrote: >>> >>... snip ... >>> open and >>> modify. You can read about the freeware version of our software: >>> "Portable FAT >>> Library for MCU Applications" Circuit Cellar, March 2005. >>> >>> We also have a commercial version that we license. We would be eager >>> to adapt it >>> to suit your needs and provide full support to ensure a successful >>> integration into your product. If you are interested, please do not >>> hesitate to contact me. >> >>You would do much better with this sort of announcement if you paid >>even casual attention to the formatting of your article. This sort >>of thing doesn't engender any belief in the accuracy of your code. >>In fact, I would expect it to be extremely buggy. > > It read fine here and the formatting was consistent Mr Smartypants. > I wonder what your code quality is like? >
It's poorly formatted for usenet, the line length is too long. Sure, I could muck around with settings on my newsreader, and probably get it to look OK, but, why would I bother? -- Richard
Richard wrote:
> MSC <spam@spam.com> wrote >> CBFalconer <cbfalconer@yahoo.com> wrote: >>> Rizun wrote: >>>> >>>... snip ... >>>> open and >>>> modify. You can read about the freeware version of our software: >>>> "Portable FAT >>>> Library for MCU Applications" Circuit Cellar, March 2005. >>>> >>>> We also have a commercial version that we license. We would be eager >>>> to adapt it >>>> to suit your needs and provide full support to ensure a successful >>>> integration into your product. If you are interested, please do not >>>> hesitate to contact me. >>> >>> You would do much better with this sort of announcement if you paid >>> even casual attention to the formatting of your article. This sort >>> of thing doesn't engender any belief in the accuracy of your code. >>> In fact, I would expect it to be extremely buggy. >> >> It read fine here and the formatting was consistent Mr Smartypants. >> I wonder what your code quality is like? > > It's poorly formatted for usenet, the line length is too long. Sure, > I could muck around with settings on my newsreader, and probably get > it to look OK, but, why would I bother?
He obviously doesn't care what impression he leaves with potential customers. He would rather have a hissy-fit over being criticized. It's not my long eared gray animal that is getting skinned. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson