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

Best method for writing to UICR during production

Please note that I am a new developer.

I am currently testing on a nRF52 DK on Windows.

I want to flash my application (which has a SoftDevice) and also write manufacturing information such as serial number to the UICR (customer reserved) registers.

I have tried using the method described in the UICR Config Example where Keil uVision is modified to write to UICR. This method works, but is not desirable. I want to use a Flasher ATE (JLink flash programmer) to flash each of my devices during production.

I have seen in some threads that it is possible to write to the UICR using nrfjprog as such:

nrfjprog --memwr 0x10001304 --val 0x00000000

Is the best method to use nrfjprog and write to each individual UICR address and then to flash the application and SoftDevice? Or perhaps it is more efficient to produce a single .hex file (using mergehex) where UICR registers are already written.

My question is: what is the most efficient way to write to the UICR registers during production?

Thanks for any help!

Parents
  • Hi,

    I see that you have already answered most of your question yourself. I do not have experience with what you describe in your answer, but I do have some input regarding your original question.

    I would rather use nrfjprog (or, if applicable, the approach that you describe,) than to generate a separate hexfile for each device.

    I would also make sure that the serial number gets written last. The reason is that some of the UICR fields may be used by an application (such as a DFU bootloader), and it is not unusual that the first step of programming a hex file onto the device is to erase all affected flash pages. In other words, existing UICR contents may get erased as part of the hex file programming.

    Regards,
    Terje

Reply
  • Hi,

    I see that you have already answered most of your question yourself. I do not have experience with what you describe in your answer, but I do have some input regarding your original question.

    I would rather use nrfjprog (or, if applicable, the approach that you describe,) than to generate a separate hexfile for each device.

    I would also make sure that the serial number gets written last. The reason is that some of the UICR fields may be used by an application (such as a DFU bootloader), and it is not unusual that the first step of programming a hex file onto the device is to erase all affected flash pages. In other words, existing UICR contents may get erased as part of the hex file programming.

    Regards,
    Terje

Children
Related