OK, firstly I should say that I'm aware there has been recent discussion of embedded FAT here. I have looked at Lewin Edwards' DOSFS 1.01, FatFS R0.02a and Sham's Fatlib v2.0.
I have an ARM7 based instrument that already is in production but would like to a support for external memory cards to store measurement data and configuration. The system only has 128K RAM and 4 MByte Flash internally (plus 32K RAM in the CPU). Much of the RAM is used but can probably find a few K, maybe 6K. There is already a file system in part of the Flash that can store 'files' - about 2.5 MB, the rest of the flash is the code image that runs directly. The file system is a simple one of my own design.
Now, it would be nice if could optionally use a SD card to store this data, or at least be able to backup and restore from it. To do this though I would need to map the SD Card FAT system to match my API or at least pull the two toward each other. I suspect that I use too much functionality though. I can open, read, write and seek in files. I can create, delete and rename files & directories (including moving in the tree), also inumerate directories. There is a current working directory. File names are up to 31 characters, including spaces and upper and lower case - but not Unicode.
First problem. None of the three FAT modules above support long file names. So, the first question is how easy might this be to add, or is there code out there code available that can do this.
Next, Fatlib seems to be far to limited. The API allows opening files, reading and writing. No enumeration, delete, rename etc. So I have discarded this for now.
Next, DOSFS has much more - enumerate directories, seek, delete, multi-volume, but no rename (though I suspect that should be to hard to add at least for in situ). However, the first test I tried was to build the emulation that uses a disk image but this produced an error. I created the directory MYDIR1 required for the test on the real card before taking the image. Before the test the directory has entries for . and .. but aftwards it had entries for . and WRTEST.TXT - it had killed the .. directory!
Finally, I had a look at FatFS. The big problem here is that it does not support a current working directory. All path names are treated as full. Nor does it have rename, but perhaps I can live with that. I guess I could fix the current directory issue at the textual level by a layer prefixing text to the file names.
But still, none of these has long file name support.
Has anyone out there used any of these FAT modules in earnest? Has anyone got a better solution or patches that give long file name support? If not then I'll either try to add long file names to FatFS or find some work-around in the instrument to avoid the need.
Many thanks, Peter