This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

flash max number of writing ?

Hello !

I have read in DevZone, but still not sure regarding nRF52832 .

For nRF52832 and page size 4k, and regarding only writing zero-bits.

Can I in same page perform total 6144 number of 32-bits writings (6 times each 32-bit address) without erase that 4k page?

Edit: "corrected to 6 times".

Best regards Lennart Vedin for tss.se

Parents
  • In the Flash we use, after the flash is erased, all bits in the flash are set to '1'.

    When you write something to the flash memory address, the data is stored by writing 0's of that data to the given flash memory address but the 1's are not toggled. So this would mean that you could only write once to a memory address in flash before you need to erase the whole page again. So you cannot write 6144 words at different times to a 4092 bytes (1023 words) page without any erase operations done.

    That is the reason flash endurance is given only in erase cycles and not so much in write cycles

Reply
  • In the Flash we use, after the flash is erased, all bits in the flash are set to '1'.

    When you write something to the flash memory address, the data is stored by writing 0's of that data to the given flash memory address but the 1's are not toggled. So this would mean that you could only write once to a memory address in flash before you need to erase the whole page again. So you cannot write 6144 words at different times to a 4092 bytes (1023 words) page without any erase operations done.

    That is the reason flash endurance is given only in erase cycles and not so much in write cycles

Children
  • In the Flash we use, after the flash is erased, all bits in the flash are set to '1'.

    That's universal to all flash used by all microcontrollers - not just Nordic.

    When you write something to the flash memory address, the data is stored by writing 0's of that data to the given flash memory address but the 1's are not toggled

    Indeed.

    this would mean that you could only write once to a memory address in flash before you need to erase the whole page again

    Not quite.

    You can write again to the same location,  but only to change more ones to zeros - you cannot write zeros back to ones. 

    Back at the pencil-and-paper analogy, it's like you can change a 'P' to an 'R' - by just adding the extra stroke - but you cannot change the 'R' to a 'P' without erasing.

    This can be useful, for example, in having a bitmap to show you which addresses in Flash are "dirty" - you just clear another bit each time another address is used.

    That is the reason flash endurance is given only in erase cycles

    Indeed.

Related