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

initializer element is not constant in expansion of macro 'NRF_UICR'

hello Nordic

i am working with nrf52840 sdk16.0 s140

i wish to read the UICR register value like this :

uint32_t serial_number = NRF_UICR->CUSTOMER[0];

but i get this compilation error

5> nrf5-sdk/modules/nrfx/mdk/nrf52840.h:2834:37: error: initializer element is not constant
5> D:\Ziv\projects\Audio_sticker_FW\src\ble_audio_sticker.c:82:26: note: in expansion of macro 'NRF_UICR'
Build failed

since it is a define in the nrf52840.h file it is not a variable that i can initiate, even more i want to flash the UICR with nrfprog or something outside of the code so in production it will be possible to give different uicr to each unit without changing the compiled code

any idea how to solve this issue or what is the cause ?

hope to read from you soon

best regards

Ziv

Parents Reply Children
No Data
Related