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 FAT formatted flash I use is written so rarely that I do not have any such problems; however, in another flash app I do have that problem. What I do is that I rely on the fact that erases flash is 0xff. arrays[16] // pointers to 16 "start points" pseudo code so to read I do the following while (array[index].mark != 0xff) index++ index -- index point to last written array - use it to write while (array[index].mark != 0xff) index++ if index = 16 erase this part of flash and set index =0 index point to array to write With the above, I have multiplied the endurance of the flash 16 times Erik
"I rely on the fact that erases flash is 0xff." Aren't you also relying on your data never containing the value 0xFF? Or, at least, relying on your data never starting with the value 0xFF?
I did not try to show complete code, just the principle, but OK: one byte, of what is written in an area, (.mark in the above) is written zero when an area is written to. That byte (could be just a bit) has no other purpose. Erik