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

How to change a UICR register value when APPROTECT is enabled on the nRF52?

Background:

First, let me state that this is a huge amount of contradictory information on this forum due to the UICR registers behaving differently for each generation of nRF.  Please only comment if you know how the nRF52840 works.  

Also, in general, in order of ease of changing values, the industry standard language is to use: RAM > Registers > Flash > OTP.  I sincerely hope that UICR REGISTERS are not one time programmable (OTP) as it seems. If so, Nordic need to change the name of these to OTP!!!

Question:

I'm able to change the UICR registers using the NVMC when APPROTECT is disabled, but not when APPROTECT is enable.  Is this the intended behavior?  Is there any way to work around this?

Thanks,

Dave

  • Hi Dave,

    Also, in general, in order of ease of changing values, the industry standard language is to use: RAM > Registers > Flash > OTP.  I sincerely hope that UICR REGISTERS are not one time programmable (OTP) as it seems. If so, Nordic need to change the name of these to OTP!!!

    The user information configuration registers are non-volatile registers that can be re-written to but has to be erased after n_write times before you can write to it again.  

    I'm able to change the UICR registers using the NVMC when APPROTECT is disabled, but not when APPROTECT is enable.  Is this the intended behavior?  Is there any way to work around this?

    Are you writing to the UICR from your application or trying to write to it externally with a debugger? In short, the APPROTECT feature disables the debugger interface which disables the option for an external user to read-out, erase or write to the memory. If you're writing from the application then the issue is probably that you're trying to write to it more than n_write times. 

    Lastly, if you see any information that you mean is contradicting on this forum than I strongly suggest that you read the product specification to get the correct information. 

    Relevant section in the Product specification. 

    regards

    Jared   

  • Hi Jared,

    I'm attempting to program the UICR "registers" from inside the firmware, using nrf_nvmc_page_erase() followed by nrf_nvmc_write_word().  I'm able to do this successfully when APPROTECT is not enabled.  

    The APPROTECT feature can be enabled by setting UICR register 0x10001208 to 0x00.  Once this register is cleared, it cannot be set again unless the whole device is erased, as stated in the OPS.  But, I don't see anything in the OPS about other UICR registers being affected when APPROTECT is enabled.

    Thanks,

    Dave

Related