I thought I'd post a note here that I am working on a FAT16/32 driver for AVR.
I know there are some commercial ones available, but I'm working on a GPL project, so that really didn't fit. YAMPP's FAT routines appear to be read routines, and fatdriveravr (which is an excellent project, BTW) has some limitations for my purposes.
My requirements include:
- Ability to read and write files
- FAT16 and FAT32 support
- long file name support
- support for master and slave devices
- very low RAM requirements (600 bytes or so)
- no external interface required
- support for drives >137GB
- no external library requirements
Obviously, not all of the requirements are met yet, but I've only been writing code for a few days. I have partition read, rootdir read, subdir read, and file read routines working. 3 ports are all that is needed to interface (as in many other projects). FAT16 8.3 and LFN dir support is working, and FAT32 is coded, though I need to test it. sector chaining appears to work. master and slave device support is working. reads can be done with just a 512 byte buffer and some longs and such, with an additional user supplied buffer for names when doing dir reads (can be small as 8+3+2, or 256 bytes. I am still tracking down docs on 48 bit addressing mode for drives >137GB, but I think I know how to do it, and it's not the biggest priority. It looks like writes can be done with a single 512 byte buffer, but that code is not done yet Multiple open file support is in place, though there are limits given memory requirements. The fd structure is about 40 bytes, so you can have a handful of files open in 1024 bytes. Current codebase with ATA, FAT16/32 read routines is about 4200 bytes, so I am hopeful write will add no more than a couple more k. Code is in C, and should be portable to any processor.
However, if someone knows of an already completed codebase that supports the above requirements, I'm all ears. Still, even if I end up using another library, the experience of doing the IDE and FAT routines has been very educational.
I'm not quite ready to dump code into the wild, but if if there aren't other libraries that support these features and people are interested, I'll package it up and place it somewhere.