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

Store Manufacturing MAC on UICR

It that possible to store Manufacturing MAC address on UICR ? The purpose is to track the module, and protect the software..

Parents
  • Hi

    If a softdevice is not enabled you can write to UICR with the following code

    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    	*(uint32_t *)0x10001080 = 0x12345678;
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    

    which writes 0x12345678 to the user reserved UICR address 0x10001080

    If you have a softdevice enabled you can not write to UICR (not with current softdevices at least), so you would have to disable the softdevice and then apply the code above.

    Anyway, storing non-volatile data is normally performed by writing data to flash memory with the pstorage module.

Reply
  • Hi

    If a softdevice is not enabled you can write to UICR with the following code

    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    	*(uint32_t *)0x10001080 = 0x12345678;
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    

    which writes 0x12345678 to the user reserved UICR address 0x10001080

    If you have a softdevice enabled you can not write to UICR (not with current softdevices at least), so you would have to disable the softdevice and then apply the code above.

    Anyway, storing non-volatile data is normally performed by writing data to flash memory with the pstorage module.

Children
No Data
Related