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

Perm storage in UICR?

We are looking to store a unique name and number in each device as it is provisioned from the factory, and are considering using the UICR. We are using something close to the stock secure dfu/bootloader, and I'm still working through the details but the following questions have come up:

  1. Can the customer data be erased and reflashed without disturbing the rest of the Nordic software stack? Such as nrfjprog --eraseuicr
  2. If we reflash or ota the bootloader and/or softdevice, will the customer registers of the UICR be erased?
Parents
    1. Are you asking if you can delete only the custom data in UICR? If so the answer is; No, the complete UICR would be deleted. But it's possible to erase only the UICR by using the ERASEUICR register.

    2. For OTA, No. The MBR must know the start address of the bootloader. This is stored in UICR.BOOTLOADERADDR so if UICR was erased the MBR wouldn't know where the bootloader start address is.
      For reflashing, it depends. Usually only the sections you want to write to will be deleted, but if you use ERASEALL both flash and the UICR will be erased.

  • No, The MBR would not be rewritten. During a firmware update process, the MBR is never erased. The MBR ensures that the bootloader can recover from any unexpected resets during an ongoing update process. The MBR is used for copying and validating the bootloader, and copying the SD. The bootloader is responsible for validating the SD.

    UICR is ment for permanent storage of factory provisioned data as long as you never change this. If you have to change this later it will create a critical window when the bootloader address is missing. i.e. if you loose power during this window your device will be useless (has to be updated using a programmer).

Reply
  • No, The MBR would not be rewritten. During a firmware update process, the MBR is never erased. The MBR ensures that the bootloader can recover from any unexpected resets during an ongoing update process. The MBR is used for copying and validating the bootloader, and copying the SD. The bootloader is responsible for validating the SD.

    UICR is ment for permanent storage of factory provisioned data as long as you never change this. If you have to change this later it will create a critical window when the bootloader address is missing. i.e. if you loose power during this window your device will be useless (has to be updated using a programmer).

Children
No Data
Related