0
\$\begingroup\$

I have a working AT45DB and SST26VF driver I made and successfully implemented it for elm chan's FAT-FS. But as you know a NOR or NAND flash will wear out after 100,000 write cycles, so I have to include wear leveling to increase it "lifetime". Do you know of any open source middleware wear leveling block? I found Spiff, which is a file system with wear leveling included. But I was hoping to use Chan's FS as it is well maintained and quite robust.

\$\endgroup\$
  • \$\begingroup\$ FatFS is for SD/MMC cards.. not raw flash \$\endgroup\$ – hassan789 Apr 26 '17 at 5:35
  • \$\begingroup\$ Actually, FAT FS was made for magnetic disks. And we have uCs inside an SD/MMC which would take care of emulating it to be a magnetic disk. This emulation technique is achieved by wear leveling, bad block management, garbage collection etc. So yes it's not for "raw" flash, but in the end an SD is a raw flash with a micro inside it. \$\endgroup\$ – clmno Apr 26 '17 at 9:09
  • \$\begingroup\$ ok, so first you will need to implement FatFs without wear leveling on the raw flash. if you can do that (big if), I would recommend static wear leveling, as its pretty straight forward \$\endgroup\$ – hassan789 Apr 27 '17 at 5:00
  • \$\begingroup\$ also, FatFs in not really that robust, as it doesn't journal... i've used SPIFFS in the past..its ok for non critical stuff \$\endgroup\$ – hassan789 Apr 27 '17 at 5:02
  • \$\begingroup\$ Yes, I got Chan's FS working with my flash drivers. And I implemented an amateur wear leveling which basically just remaps worn out blocks with new spare blocks I had kept aside. But this, as you might have noticed isn't great. And I thought static wear leveling would be harder than dynamic WL. There would be too much book-keeping in case of static, I'm I right? \$\endgroup\$ – clmno Apr 28 '17 at 3:37
0
\$\begingroup\$

If you are using a Dataflash use a flash file system (YAFFS, SPIFFS, NIFFS) or any other. As @hassan789 said, FAT does not journal.

\$\endgroup\$
  • 1
    \$\begingroup\$ It also worth to mention LittleFS \$\endgroup\$ – desertkun Feb 6 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.