Hello,
I have a question regarding the lifetime of memory. It is considered that typical flash withstand 100000 writes more or less. I want to write a configuration file, about 10Ko in the DUE flash mem. If I write byte by byte, as is possible per DueFlashStorage examples, I will make more or les 10000 writes. So am I correct thinking that I can save my config only 10 times that way ?
Does writing a block counts for only 1 write ? this would then be the way to go ...
Any hints ?
regards
Each block write is one of your 'lifetime' writes. If you can withold the write until you really have to or 'save-up' your writes until you have significant changes to a block, you will wear out the device a lot slower.
Another option is to add a small FRAM device, store your data there until you have a block full, then copy it over. Obviously at this point you might just choose to use an external FRAM and not use the Due flash at all....
Hi dave,
Thanks for the reply,
Do I understand your answer correctly assuming that one byte write is one lifetime write, as well as one block write (regardless of the size of the block) is one lifetime write as well ?
In that case I could write my whole configuration (which I can receive and store in RAM before transferring as a whole block in flash) as much as 100000 times ?
oliver34:
Do I understand your answer correctly assuming that one byte write is one lifetime write, as well as one block write (regardless of the size of the block) is one lifetime write as well ?
Sort of, it's been a while since I used flash. It depends if the block needs erasing before a byte is written, if the device allows you to write without erasing a block then you might be able to write a single byte without using up a block write, but you'd have to keep track of your writes.
oliver34:
In that case I could write my whole configuration (which I can receive and store in RAM before transferring as a whole block in flash) as much as 100000 times ?
Yes, but I've never really believed the 100K writes, 10K for sure. I can't even find where in the datasheet it says the number of writes!
Writing the whole config is one go is definitely the way to do it. You could also implement wear-leveling on all the spare blocks to get more writes.
OK Dave,
Thanks a lot for answering and for the useful suggestions !