Compile error trying to use nrfx NVMC library with nRF54L15

Hello!

I would like to use OTP storage on the nRF54L15, as explained here:
https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/key_storage.html

That page says to use the nrfx NVMC library:
https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/data_storage.html#data-storage-nvmc

Which in turn links to the driver API:
https://docs.nordicsemi.com/bundle/nrfx-apis-latest/page/group_nrfx_nvmc.html

It seems I need to set
CONFIG_NRFX_NVMC=y
and use:
#include <nrfx_nvmc.h>

Having done that, my project fails to compile. It seems both nrf_nvmc.h and nrfx_nvmc.h have trouble finding certain symbols. This is an excerpt from the errors:

.../modules/hal/nordic/nrfx/hal/nrf_nvmc.h:75:35: error: 'NVMC_CONFIG_WEN_Ren' undeclared here (not in a function); did you mean 'RRAMC_CONFIG_WEN_Min'?
75 | NRF_NVMC_MODE_READONLY = NVMC_CONFIG_WEN_Ren, ///< NVMC in read-only mode.

.../modules/hal/nordic/nrfx/drivers/include/nrfx_nvmc.h:326:33: error: 'NRF_NVMC' undeclared (first use in this function)
326 | return nrf_nvmc_ready_check(NRF_NVMC);

It seems that NVMC_CONFIG_WEN_Ren and NRF_NVMC are defined in chip-specific include files, but I find no such include file for the nRF54L series.

According to the datasheet, the nRF54L series has UICR and OTP, so I assumed the driver would work:
https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/uicr.html

Any help would be much appreciated. My NCS version is 3.1.0.

Parents Reply
  • Set CONFIG_NRFX_RRAMC=y and include nrfx_rram.h instead. 

    Thank you, this compiles and the init function seems to work.

    I would like a way to clear the UICR.

    The NVMC API has nrfx_nvmc_uicr_erase() which erases only the UICR.

    The RRAMC API has only nrfx_rramc_all_erase() which says it erases the whole RRAM. Doesn't it mean it will erase the program calling the function as well, including the driver code doing the erasing? Or have I misunderstood the documentation?

    For key storage I recommend

    Yes, I use the KMU for encryption keys but would like to use OTP for device identity.

Children
No Data
Related