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

Erasing UICR register in application code

Hello Everyone,

I am using nrf51822 with S130. After completely erasing the chip, with the below mentioned code snippet in application code:

NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;

while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}

*(uint32_t *)0x10001080 = hexData;

NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;

while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}

I am able to write data in the UICR register. I tried subsequent writing to UICR using the same code in the application code, however, UICR data doesn't change. Based on further research I came to know that the entire chip needs to be erased for writing new data. However, I want to just erase UICR to rewrite new data to the UICR. Is there any way to erase the UICR registers in application code to rewrite new data?

Thanks

Related