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

DFU - patch/partial update possible?

Hello,

Our device has the secure BLE DFU enabled. In a mass programming situation we need to apply a hotfix to each device and replace a previously hardcoded value with a per-device ID. We also need this process to run as quickly as possible - is there a way to craft a DFU payload to update 4 bytes of the application code, or do we have to create a new signed firmware image for each device and perform a full update?

Parents
  • Hello,

    If you want to change only a small piece of the code, you need to generate a new hex file, and hence create a new DFU image, unfortunately. The reason for this is that once you change only one bit in the hex file, the CRC changes, and the bootloader will reject the application, so if you hardcode an application for each device, you need a separate image for each device. 

    What you can do is to tell the application to use the UICR, which has a unique ID. This way it will only be one .hex file for all the devices, but as I said, you will have to perform a DFU (or manually program) all of the devices with this new application. If you want to manually program each device, you can generate a bootloader settings file with the application and bootloader, and flash them together.

    Best regards,

    Edvin

Reply
  • Hello,

    If you want to change only a small piece of the code, you need to generate a new hex file, and hence create a new DFU image, unfortunately. The reason for this is that once you change only one bit in the hex file, the CRC changes, and the bootloader will reject the application, so if you hardcode an application for each device, you need a separate image for each device. 

    What you can do is to tell the application to use the UICR, which has a unique ID. This way it will only be one .hex file for all the devices, but as I said, you will have to perform a DFU (or manually program) all of the devices with this new application. If you want to manually program each device, you can generate a bootloader settings file with the application and bootloader, and flash them together.

    Best regards,

    Edvin

Children
No Data
Related