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

Nrf52 flash programming : 'writes in a block between erase'

In the nrf52 OPS datasheet, for NVM and flash programming electrical specification (page 41) it has "Amount of writes in a block between erase" and Minimum for that is 181.

What does that actually mean?

For example, I know and understand "Write/erase cycles", but this is a new one on me.

A sector in nrf52 has 4K which means 1024 dwords. Which means I could end up having 1024 write operations before it is full. So the 181 specified can't be referring to how many times I could write.

To make matters worse, there are 32 bits in a write operation, so there are 32768 bits. So I could theretically have 32 seperate write operations at each of the 1024 locations, giving me a total of 32768 write operation before I would have to erase the block.

I am confused !!

Hope someone can clarify.

  • Section 10.1 "The same block address in the NVM can only be written nWRITE number of times before an erase must be performed using PAGEERASE , ERASEUICR, or ERASEALL."

    nWrite is a minimum of 181. So you can write any address in the page 181 times at a minimum before you have to erase the page. Not that that would be very useful as you can only change it a maximum of 32 times before you have all bits set to zero.

    I assume the 181 times includes times you write it but don't actually change anything, else it really would be meaningless.

    Basically not much of a restriction.

  • Phew!! That is a relief. Thank you very much for explanation. I have developed a flash file system and it can result in writes often, potentially up to 32 times as I drop a bit to 0 for a mechanism to write atomically to a block of words multiple times

  • yeah I have one of those too - I keep state in a 32 bit word and drop a bit each time I move from one state to another, it's very useful. That lets me mark blocks as allocated, then in-use, then dropped etc, kind of like a filesystem.

  • Hi RK,

    Do you mean 181 writes at any address of the page or of the block ? Spec says "Amount of writes allowed in a block between erase", but I am confused about nordic's use of page and block. Usually in NAND datasheet a block is made of page, this is reversed in NRF52 chip. But on the block protection module a block is defined as a 4KB unit, which is the size of the page on the memory layout, while the block is 512B.

    I have some understanding doubts about this 181 write spec as a block is said as 512B while writing 181 times one word is 724B. So limitation appply for bit to bit writing only...

    So is it 181 write in the same block or in the whole page?

    Thanks,

  • Section 8.2 in the v1.2 spec sheet states, "Each Page is divided into 8 blocks." Taking that into account, It seems that you can safely write each word once in a page (128 words per block, 8 blocks per page), plus a bit more.

    The datasheet is a bit vague with this, and it would be nice to get some clarification from Nordic on this question.

Related