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.

  • Sigurd,

    Thanks for your help, but I think you misunderstood me. I use UICR register only to get the start address of bootloader: #define BOOTLOADER_START *(uint32_t *) (NRF_UICR_BOOTLOADER_START_ADDRESS)

    My question was about ACL. I tried to setup a write protection on first bootloader flash page but had no success.

    NRF_ACL->ACL[0].ADDR = BOOTLOADER_START; // Write address to ACL address register (0xF0000) NRF_ACL->ACL[0].PERM = ALC_WR_PROTECT; // Write protection bits to ACL address register (0x02) NRF_ACL->ACL[0].SIZE = BOOTLOADER_LENGTH; // block length to protect.

    And after that I try to erase flash page at address 0xF0000 nrf_nvmc_page_erase(BOOTLOADER_START);

    And it is erased so it looks like ACL register values are ignored.

Reply
  • Sigurd,

    Thanks for your help, but I think you misunderstood me. I use UICR register only to get the start address of bootloader: #define BOOTLOADER_START *(uint32_t *) (NRF_UICR_BOOTLOADER_START_ADDRESS)

    My question was about ACL. I tried to setup a write protection on first bootloader flash page but had no success.

    NRF_ACL->ACL[0].ADDR = BOOTLOADER_START; // Write address to ACL address register (0xF0000) NRF_ACL->ACL[0].PERM = ALC_WR_PROTECT; // Write protection bits to ACL address register (0x02) NRF_ACL->ACL[0].SIZE = BOOTLOADER_LENGTH; // block length to protect.

    And after that I try to erase flash page at address 0xF0000 nrf_nvmc_page_erase(BOOTLOADER_START);

    And it is erased so it looks like ACL register values are ignored.

Children
No Data
Related