Hello,
I am using nRF52840, SDK_16.0.0, SoftDevice S140 V7.0.1 and Segger for flashing the image. I am using ‘ble_app_blinky’.
1) I want to write Serial number into UICR register. Since SoftDevice is enabled, I am not able to update UICR register. If we can update UICR even with SoftDevice, please let me know the procedure.
2) I follower below approach. Write UICR register with 5 bytes of Serial number and then reset the chip. Is this approach fine.
a) Is waiting for busy state of NVMC is correct ?
void writeSerialNumber(uint8_t* p8SeralNumber)
{
// Disable Soft Device
sd_softdevice_disable();
// Write Serial Number into UICR register
nrf_nvmc_write_bytes((uint32_t)0x1000108C, (const uint8_t *) p8SeralNumber, 5);
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NVIC_SystemReset();
}
3) Whether NVIC_SystemReset() do a complete reset. To my understanding it’s a Soft reset. Correct me if I am working.
a) How about RAM during Soft reset. Will it be erased ?
4) Using nrfjprog, if I try to re-write I will get error. But I dont see such mechanism when I use nrf_nvmc_write_byte(). It is a void function. In this case, do I need check before writing.

Thanks & Regards
Vishnu Beema