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

UCIR: write protection?

Dear experts,

How is the UCIR protected against rewriting? I would like to store some ID's which I want to be sure they cannot be erased or over-written once programmed. I would like to use the UCIR as a kind of one time programmable meamory (OTP).

I know this statement from the nRF52840 manual:

"UICR can only be written nWRITE number of times before an erase must be performed using ERASEUICR or ERASEALL."

nWRITE is 2. That means that once programmed, it can be overwritten at least 1 time after the UCIR was programmed for the 1st time. How can I deal with that, write it two times at our factory?

Thank you for any tips on that, Reto

Parents
  • Hi Reto,

    the UICR registers are non-volatile memory, which means you can change bits from 1 to 0 in a register and you have to erase it, which sets it all back to 1s, again before you can clear the bits again.

    So a nWRITE of 2 means that after initially writing a value to a UICR register you will be able to change 1s to 0s once before you need to erase it in order to write to it again.

    As stated in the nRF52840 Product Specification, the only way to erase the UICR registers using ERASEUICR (which will erase all the UICR registers) or ERASEALL(erase the entire chip).

    Best regards

    Bjørn

  • Thank you Bjørn! I am familiar with the flash concept (flash memory can only be written to when erased before and all bits are set to '1'). However, your answer clarified it for my (what nWRITE=2 means).

    Short: the UCIR is a normal flash page, with the only difference that you have to erase it with ERASEUCIR or ERASEALL commands. AND: there is no way to protect the UCIR from unwanted write access from my custom FW code. Correct? I can read and write it from my FW code, but NOT erase?

    Thanks! Reto

Reply
  • Thank you Bjørn! I am familiar with the flash concept (flash memory can only be written to when erased before and all bits are set to '1'). However, your answer clarified it for my (what nWRITE=2 means).

    Short: the UCIR is a normal flash page, with the only difference that you have to erase it with ERASEUCIR or ERASEALL commands. AND: there is no way to protect the UCIR from unwanted write access from my custom FW code. Correct? I can read and write it from my FW code, but NOT erase?

    Thanks! Reto

Children
No Data
Related