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

Flash protection nrf52840 SDK: 14.0.0

I am trying to implement a bootloader with rewrite protection on nrf52840 with SDK: 14.0.0. But it seems that there is no flash write protection registers in nrf52840. So is there a way to implement a flash rewrite protection?

Thanks.

Parents
  • Hi,

    The BPROT peripheral that is found in the nRF52832, has been replaced with the ACL peripheral on the nRF52840. ACL works similar to the BPROT(erase/write protection), but also adds support for protection against reading the flash.

    You can find more information about the ACL here.

  • Hi,

    Thanks for the link! I tried this code:

    #define BOOTLOADER_START    *(uint32_t *) (NRF_UICR_BOOTLOADER_START_ADDRESS)
    #define BOOTLOADER_LENGTH   0x0000D000
    #define ALC_WR_PROTECT      0x00000002
    NRF_ACL->ACL[0].ADDR = BOOTLOADER_START;
    NRF_ACL->ACL[0].PERM = ALC_WR_PROTECT;
    NRF_ACL->ACL[0].SIZE = BOOTLOADER_LENGTH;
    nrf_nvmc_page_erase(BOOTLOADER_START);
    

    And after that first bootloader page (BOOTLOADER_START) is erased and all blank with 0xFF. Did I miss something?

Reply
  • Hi,

    Thanks for the link! I tried this code:

    #define BOOTLOADER_START    *(uint32_t *) (NRF_UICR_BOOTLOADER_START_ADDRESS)
    #define BOOTLOADER_LENGTH   0x0000D000
    #define ALC_WR_PROTECT      0x00000002
    NRF_ACL->ACL[0].ADDR = BOOTLOADER_START;
    NRF_ACL->ACL[0].PERM = ALC_WR_PROTECT;
    NRF_ACL->ACL[0].SIZE = BOOTLOADER_LENGTH;
    nrf_nvmc_page_erase(BOOTLOADER_START);
    

    And after that first bootloader page (BOOTLOADER_START) is erased and all blank with 0xFF. Did I miss something?

Children
No Data
Related