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

Disengaging APPROTECT

Hi,

On nRF52840, we are able to engage APPROTECT by setting NRF_UICR->APPROTECT to 0.
However, writing 0xFF to NRF_UICR->APPROTECT does not seem to disengage APPROTECT.

For example, after executing below code, APPROTECT still remains engaged:

NRF_UICR->APPROTECT = 0x00;
NRF_UICR->APPROTECT = 0xFF;

This behavior is different from nRF52832, where writing 0xFF to NRF_UICR->APPROTECT disengaged APPROTECT.

What is the proper way to disengage APPROTECT on nRF52840?
Thank you in advance.

Parents
  • Hi,

    Unfortunately, on the 52840, the only way to disable APPROTECT is through a full chip erase. UICR is placed in FLASH memory, and on the nRF52832 you could always erase it with NVMC->ERASEUICR and thus allow you to disable readback protection from the program code. However, on the nrf52840, this operation becomes unavailable once read-back protection is enabled.

    Excerpt from the NVMC chapter of the 52840 PS:

    Access port protection behavior

    When access port protection is enabled, parts of the NVMC functionality will be blocked in order to prevent intentional or unintentional erase of UICR.

    Table 1. NVMC Protection
      CTRL-AP ERASEALL NVMC ERASEPAGE NVMC ERASEPAGE PARTIAL NVMC ERASEALL NVMC ERASEUICR
    APPROTECT              
    Disabled Allowed Allowed Allowed Allowed Allowed    
    Enabled Allowed Allowed Allowed Allowed Blocked    

    Best regards,

    Vidar

Reply Children
No Data
Related