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

What is the real nRF52840 max writes to a flash block?

The nRF52840 OPS 0.5.1, describes nWRITE,BLOCK as the amount of writes allowed in a block between erases, and lists nWRITE,BLOCK = 403 Maximum.

It looks like 8 blocks are in a 4 kB page, so each block is 512 Bytes.

Does this mean that only 403 of the 512 bytes in a page can be written? Or does the 403 number mean something else?

Parents
  • Ah, the NVMC only supports 32 bit write operations, so it takes 128 write operations to write the entire 512 byte block. That leaves 275 additional writes available to overwrite individual addresses within that block.

    So the entire block can be written without violating the nWRITE, BLOCK spec. And there are enough additional writes to allow the entire block to be overwritten a second time.

  • There's a spec for nWRITE that applies to a single address. For the nRF52840, nWRITE is 2. I think that means you can write a single address 2 times max. So I don't think there is any way to exceed nWRITE, BLOCK without first exceeding nWRITE.

    When I first posted the question I forgot that all flash writes had to be 32 bit. Now that I understand that, I can't find a way to exceed nWRITE, BLOCK without surpassing the max number of writes for a single address first.

    Yes, writing to the flash only clears bits. But this is still helpful for keeping non-volatile counters.

Reply
  • There's a spec for nWRITE that applies to a single address. For the nRF52840, nWRITE is 2. I think that means you can write a single address 2 times max. So I don't think there is any way to exceed nWRITE, BLOCK without first exceeding nWRITE.

    When I first posted the question I forgot that all flash writes had to be 32 bit. Now that I understand that, I can't find a way to exceed nWRITE, BLOCK without surpassing the max number of writes for a single address first.

    Yes, writing to the flash only clears bits. But this is still helpful for keeping non-volatile counters.

Children
No Data
Related