Hello experts, I am developing a C165 based mass storage device and need to implement a FAT file system on flash. I've read a lot about problems with the life time of NAND due to repeated read/write of the FAT and ST talk about wear levelling software and journeling which are basically jump tables relating vitual addresses to physical addresses to combat the problem. I know that there are commerical file systems offered by companies and would really like to know if anyone has experience of any of these or selecting NAND for this purpose. All advice and links greatly appreciated, Best regards, Malcom.
The "flash translation layer" is more or less the bottom half of the file system. They usually handle bad block replacement. They may or may not cope with wear levelling; some of them do. Unfortunately, I'm not intimately familiar with the MMC spec. a data logger updating at 4sec intervals One key point is that flash lifetime is limited by the number of erase cycles, not programming cycles. You can write to flash all you want; you just can't erase a sector more than 100K or 1M times. Erasing sets all bits to 1; programming changes 1s to 0s. You need not erase flash every time you issue the program command. And you can even program the same word of flash multiple times without erasing -- just so long as you never have to set a bit back to 1. (You might, for example, have some sort of used/unused bitmap that gets checked off every time you log a set of data.) So, if you log, say, 16 bytes of data per sample, and your flash sector is 64K, you can store 4096 samples in one sector before having to erase it. If you have, say, 8 64k sectors of flash, you could just round-robin your way through it all, 32000 samples or roughly 36 hours of operation per erase cycle. That observation might help your particular application, depending on the size of your samples.
As far as I know SecureDigital cards do wear leveling on their own internally. SD cards can be interfaced using SPI using the MMC compatibility layer.