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

nrf_nvmc_write_word throws NRF_FAULT_ID_APP_MEMACC

Using nRF52840 SDK 15.0.0 with SoftDevice

I am trying to protect the Access Port, used to do it using the following command

    nrf_nvmc_write_word(NRF_UICR->APPROTECT, 0xFFFFFF00)

Now, when using SD - this command throws an app_error with ID 0x1001 (NRF_FAULT_ID_APP_MEMACC)

Parents
  • Hi Elkana,

    According to this softdevice specification, peripheral Id 30-> NVMC is a restricted peripheral when softdevice is enabled. That means that it is not allowed to access NVMC registers directly from application as those registered are inside access protected area. And you can see in the implementation of nrf_nvmc_write_word that it is accessing NVMC registers directly, hence the memory fault.

    Since softdevice does expose any API to write to UICR, the only way is to disable the memory protection temporarily write to UICR register and then enable it again, You can do the same think that  I proposed in this thread.

     

Reply
  • Hi Elkana,

    According to this softdevice specification, peripheral Id 30-> NVMC is a restricted peripheral when softdevice is enabled. That means that it is not allowed to access NVMC registers directly from application as those registered are inside access protected area. And you can see in the implementation of nrf_nvmc_write_word that it is accessing NVMC registers directly, hence the memory fault.

    Since softdevice does expose any API to write to UICR, the only way is to disable the memory protection temporarily write to UICR register and then enable it again, You can do the same think that  I proposed in this thread.

     

Children
Related