LPC111X family - maximizing flash write cycles

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC111X family - maximizing flash write cycles

683 Views
accelmotion
Contributor III

I want to maximize the number of write cycles to flash memory, utilizing IAP.

I understand the block and page formats for writing and erasing.

I propose: segment a 256-byte block of RAM into sixteen 16-byte subsections, and keep 16-bytes of data in one 16-byte data struct or string inside the first subsection, with all other data bytes as FF.

  • flash the first block access - only first subsection written
    • move data string to next block subsection (assuming less than 16) in RAM
    • zero previous location
  • flash next block access, incrementing until the last (16th) subsection in block is used
    • move data string back to subsection 0 in RAM
    • set all other locations to FF in RAM
    • ERASE BLOCK once
  • as the number of write/erase cycles exceeds some limiting value for that block, move to next block and start again. example: subsection 1 thru 16 each doing 2500 write/erase cycles (using that as a safe guardband from 10k).
  • as each block is exhausted, increment the block # and continue with the above subdivision of the block starting with subsection 1. Write all exhausted blocks to 00.

In one sector this should yield 16 x 2500 x 16 blocks = 640,000 write cycles instead of 10,000.

Assumptions:

  • that writing 16 different times in same block before an erase is OK
    • data moves from FF -> data -> 00 (to encode the state of the subsection for next cold restart analysis) so no erase is needed as it moved through the subsections writing repeatedly to the same block
    • that the limit in erases is the 10K limit and writing each section with more 0 or more FF doesn't increase the wear

OK, so where have I gone terribly wrong?

Also, why have the links to the various APnotes for this sort of thing (like AN11008) gone to?

Labels (3)
0 Kudos
4 Replies

508 Views
accelmotion
Contributor III

OK, I really botched up this question, but it at least states what I want to do.

Update:  move a small subblock of data throughout the block writing each block 16-times; then move to next block once exhausted; then only erase the entire sector and start again at zero once entire sector traversed (in my case its sector 6). This should yield:

  • 16 block writes, each using the next subsection of the block (FF -> data -> 00)
  • 16 blocks per sector = 256 subsection writes/sector erase
  • 5000 or so sector erases = 1,280,000 writes   or 2500 sector erases = 640,000 writes

The idea is that each cell only sees 5000 writes and 5000 erases total in this method. FFs writing over FF doesn't stress the cell and writing "00" over "00" shouldn't either. Each cell transitions to "0" completely only once per pass.

Try again? Any thoughts if this is wrong or right?

0 Kudos

508 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi David,

   Do you use the IAP command? IAR don't have the block erase, it just have the sector and page erase.

  pastedImage_1.png

Actually, the endurance will be count after program/erase cycles, no matter how your operate it, when you program, then erase, then the according flash area will count one endurance cycle. so to the specific flash address, the min 10000 endurance cycles won't be changed.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

508 Views
accelmotion
Contributor III

Yes, I see that I missed two important aspects of programming the LPC1114: sector erase limit and block programming limit.

But, if I utilize the method I described above, where I repeatedly index my small data chunk into a block, taking the chunk from FF to data, then incrementing to the next chunk location in the block, each time programming but not erasing, then I do increase the endurance by the ratio of the chunk times the block. With a 8-byte chunk there will be 32 locations in the block, times 16 blocks in the sector -- we index inside the block changing the chunk from FF to my data, and the previous indexed chunk to 00, then program the whole block.

FFs onto FFs don't stress, and 00s onto 00s don't stress -- therefore, as you move from block to block with the chunk changing each time only from erased to programmed, each cell is only stressed once -- then erase the entire sector at the end, and start over.

That does change the endurance. By a whole lot. In the example I gave it goes from 10,000 to 5,120,000 times for each sector.

0 Kudos

508 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi David,

   Thanks a lot for your detail reply!

   I think if you have interest , you can test your own method on your side, just to check, whether it is really change the endurance, but from the NXP side, we still don't have the test result about your method.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos