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

Can I write an available UICR register directly with nrfjprog.exe?

I want to use a UICR for device serial number. Correct me if I am wrong but it is my understanding that a UICR cannot be changed programmatically like onboard flash can. So right now I can use the free version of MDK to compile the example code to put an arbitrary value in one of the UICR registers. I do this by modifying "uicr_config.h" in "uicr_config_example" project, then compile, then load the resulting .hex file. When I load a different application hex file the custom UICR value stays but when I reload the soft device, it wipes the custom UICR value.

Can I have a Windows script that simply uses nrfjprog directly to write to a UICR value or must I go through the Keil project path? Thanks, David

  • Nevermind, should have tried "nrfjprog -h" first before I posted the question. Almost everything is spelled out there. For the 51422, if you have the soft device programmed then you can't erase the UICR without either reprogramming the soft device or erasing all. Once the UICR is erased, you can write what you want to the unused registers with nrfjprog --memwr Address --val value

Related