2011-05-07 08:04 AM
Overwriting data in SPI Flash
2011-05-17 05:34 AM
Yes, that's pretty much how most file systems work.
Some sectored SPI flash devices have one or two staging buffers (internal RAM or registers), which can be used to hold data and perform modification without pulling it all across to the CPU. You might consider techniques like caching, lazy writes, and journaling, to mitigate unnecessary erase/write cycles.2011-05-17 05:34 AM
H Saf,
You can find/buy file systems that take care of all this. I developed a simple power failure resilient one that I use on several projects (simple in that file space is allocted at compile time). It has a standard fopen, fread, fwrite, fseek, fclose etc. type interface. Read only is possible with very little code which is good for bootloaders. Let me know if you are interested as I might be able to licence to you. There are many other file systems that go further allowing dynamic allocation and wear levelling etc. etc. but can become quite complex. Regards Trevor