Developer page about implementing the FAT filesystem or some alternative
FAT alternatives
Raw device
It is possible to log without FAT implementation, or with a lightweight FAT16 that writes to a file preallocated in the filesystem on the MMC flash. RAM requirements for FAT are high, 600..1000bytes all told.
I have doubt that there is need for filesystem at all.
Pros of filesystem:
- the same card can be efficiently shared with other uses, like a digital camera, mp3 storage or transportation of files
Cons:
- burns SRAM for the location of next blocks in the file, also some CPU
If we just support writing to the Nth (1..4) partition, that should be fine. It means that the partition used for logging cannot be used for storing photos, mp3-s at the same time. But who cares? Many motec has just 1 Mbyte for logging, so wether one uses 30% or 100% of a cheap 256Mbyte MMC for logging VEMS runtime data, he'll be satisfied.
Reading raw data is no problem on quality OS-es. A partition on a device can be directly written to. It can simply be read on linux.
Most likely works on win32 too (in the worst case a big file is created on the empty device that spans the whole device).
Other filesystems
Tiny OS has a simple file system for Atmel AT45DB041 serial flash (MMC can be max a buffering harder). (Simply byte-)Logger and FS are both useful in writing data to the flash.
FAT16 implementations
Important note: surprisingly, read-only FAT filesystem works for logging: even an ro interface must be able to find out the location of Nth (or next) block of file "xxx". Read-only means it cannot allocate new dirs/files/blocks. But it's not hard to create 1 or 2 files beforehand. Definitely, we want to store the start of sessions in a way that is easy to find without reading through 200Mbytes of data: separate file, or special purpose area at the file beginning.
- http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2000/peterdan/final.htm an mp3 project: note the added parallel-port MMC programmer too
- http://ccrma.stanford.edu/courses/250a/docs/avrlib/files.html
- http://hubbard.engr.scu.edu/embedded/avr/avrlib/ read-only
- http://www.mcselec.com/avr-dos.htm Should we order the 99 Euro licence from ? Jason, maybe you could order from the VEMs paypal account if you aggree. I think it's >30% that we'll use it (from C, of course).
- http://www.prllc.com/prllc_homemainFlash.htm These guys have a C library which handles MMC/SD and FAT 12/16. Looks almost ideal to me, the only downsides are the licensing (single user for sourcecode) and it's not built for GCC "out of the box". Still, there's no reason the objects can't be precompiled and linked, and PRLLC says their code can be ported. The functions themselves are defined in their published docs, so if we added appropriate #ifdef MMC or similar, we could make that work. Cost for the sourcecode package is $139 USD.
- Yampp MP3 player
- FAT, long filenames:
See also