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

nrfx_nvmc.h API cannot write to UICR

Summary: nrfx_nvmc_word_write() and similar functions can't write to UICR.

(Note that we are not using the full SDK, only nrfx)

We have used the API provided by hal/nrf_nvmc.h to write to words in the UICR region. As of nrfx V2.0.0, nrf_nvmc_word_write() and similar functions were deprecated and removed.

The new functions provided by nrfx_nvmc.h do bounds checking on the write addresses, to make sure they are in the regular flash area, e.g.:

void nrfx_nvmc_word_write(uint32_t addr, uint32_t value)
{
    NRFX_ASSERT(addr < flash_total_size_get());
    ...

But the UICR addresses are out of range of regular flash, so the NRFX_ASSERT above fails.

Is it intentional that these functions prevent UICR writes? Should we be writing UICR words with some other API functions? We will have to do low-level writes directly ourselves otherwise. Thanks.

  • Hi,

     

    Is it intentional that these functions prevent UICR writes? Should we be writing UICR words with some other API functions? We will have to do low-level writes directly ourselves otherwise. Thanks.

    My apologies for this behavior. This is not intentional, and I will report this as a bug back to our nrfx team. Thank you very much for letting us know, and helping us improve our drivers.

     

    Kind regards,

    Håkon 

Related