Flash Endurance on nRF52

Hi, after some research and reading several posts (especially this one), I am still confused about the Flash endurance on the nRF52.

In the product specification for the nRF51288 (chapter 6: Absolute Maximum ratings), there is a foot note on the Flash Endurance value:

Flash endurance is 20,000 erase cycles. The smallest element of flash that can be written is a 32 bit word.

On the nRF52, flash endurance is only 10,000 cycles. But the foot note that restricts this value to erase cycles it missing in the nRF52 product specification. In the post mentioned above, Hung Bui states the following:

So 10000 erase/write cycle mean you can do 10000 erase and 10000 write.

Now, what does 10000 write mean? When I have a look at the Flash drivers, it seems like Flash is written in separate 32 bit words. So it shouldn't make a difference if I write a whole page (4096 bytes) in one batch or if I write 4 bytes let's say every week or each time a specific event happens. The wear on the flash should be the same. Is this correct?

In regard of this fact, how is the n_WRITE,BLOCKvalue (which is 181) to be interpreted? If I write a whole block on the nRF52 (512 bytes = 128 words of 32 bit), did I already use 128/181 write operations? Or is this considered 1/181 write operation?

By the way, in nRF52 product specification 1.1 chapter 11.1, the n_WRITE parameter is not blue anymore (no link) and can easily be missed when looking over the document.

Here are two scenarios concerning flash endurance that I have some trouble with (as we want to make sure to get reliable values):

(1) I use one page for storing my dynamic data. My data is 32 bits wide and must not be 0. Starting with the first word in the Flash page, each time my data changes, I set the previous word to 0 and write my new data into the next word. So each word will be written exactly two times until the page is full. Then I will erase the page and start with the first word again. Upon system reset, I walk through the page and scan for the first 32 bit word that is not 0, which I use to initialize my system. Is this scenario guaranteed to work for 10000 erase cycles, which would allow for 1024*10000 changing data values? If not, will be the critical point be the erase/write cycles or the n_WRITE limit (each word is written exactly two times)?

(2) I use one page to count special events. For each event, I set one bit to 0. This way, I will write each 32 bit word exactly 32 times before I move on to the next word. Is this scenario guaranteed to work reliably, or will it exceed the n_WRITE limit? If it works, how many safe erase operations can I perorm? Will it be still 10000?

Parents
  • Hi

    For nRF52832 flash, you have 10.000 erase/write cycles, see the absolute maximum ratings in the ps

    It is actually the erase that causes the wear of the flash. Write does not cause the wear, but you can not write to a flash section if it already written unless you erase it first. That is why we mention write/erase cycles. When you erase a page, you will cause wear to every bit in that flash page. Then you can write words one by one to the flash page, but you will only cause another wear when you again erase the page.

    The Flash data storage library implements Basic wear leveling of the flash

    Update 19.8.2016 My understaning is this: Writing one word to a flash block counts as one write to that flash block. Writing two words to a flash block counts as two writes to that flash block. So if you write a whole 512 byte block, no matter if you write one word at once or the whole block at once, that will count as 128 writes to that flash block. In that case you are within the n_WRITE = 181 write limit, so that should be fine. There is however a description in section 11.1 that describes how to write less than one word to flash, actually writing multiple times to the same 4 byte address in flash, then you need to have the n_WRITE = 181 limitation in mind.

    Flash wearing: If you erase a page, you are causing wearing on that page. If you erase all flash, then you are causing wearing on all flash pages in flash. If you erase the same page 10,000 times, that flash page is no longer guaranteed to work. The other flash pages are still guaranteed to work if they have been erased less than 10,000 times.

    So with perfect wear leveling, you can perform page erase 10,000 * 128 = 1,280,000 times, since there are 512/4=128 pages in nRF52832 QFAA/CIAA flash memory. Similarly, with perfect wear leveling, you can write 10,000 erases/page * 128 pages * 8 blocks/page * 181 writes/block = 1,853,440,000 times to nRF52832 QFAA/CIAA flash memory.

    Note that flash page can most likely be erased much more than 10,000 times, but 10,000 times is the minimum.

  • Hi vit, somehow my reply from yesterday disappeared... anyway, thanks for the explanation! Can anyone from Nordic Semiconductor confirm this behavior? Because it would mean that my scenario 2 (using flash bits to count events) will work without causing unexpected wear.

Reply Children
No Data
Related