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

NRF52 DFU ZIP Generation

Hi,

I want to be able to update the bootloader along with the application via OTA DFU. I know I can't generate both the application and bootloader in one image/zip so I have to make two different zip packages. 

I can't find any guide on how to do that. Please help out. 

Parents
  • Hi,

    Then you must make two different zip packages, one for the bootloader and one for the application. Then do the updates after each other, first bootloader then application.

    Regards,
    Terje

  • i get this error:

    DFU failed with error: When writing 'EXECUTE' command to Control Point Characteristic of DFU Target: Operation code 4 (EXECUTE) failed on DFU Target. Result code 4 (INSUFFICIENT_RESOURCES).

    I made the zip for the bootloader using this command:

    nrfutil pkg generate --hw-version 52 --bootloader-version 2 --bootloader secure_dfu_ble_s132_pca10040.hex --sd-req 0x9D --key-file private.key app_dfu_bootloader.zip

  • Hi,

    First, yes, you must perform two separate DFU updates.

    INSUFFICIENT_RESOURCES on the bootloader most likely means that the new bootloader is larger than the previous one, so there is not enough space within the flash area designated for the bootloader. Have you modified the bootloader, or are you built the debug version? See the thread Bootloader Update fails (INSUFFICIENT_RESOURCES) for more details.

    Regards,
    Terje

  • I don't know how to generate the init packet. i have found a couple of guide but it isn't clear to me. could you please help. I though the init file is the manifest one when generating the zip

  • Hi,

    The init file is generated when you generate the zip package, yes.

    For an update with just one part (either application, softdevice or bootloader) you should get three files in the zip. There should be a .bin file, which is the binary for the firmware update. There should be a .dat file, which is the init packet. There should be a manifest.json, which states what kind of update it is, and list the bin file and dat file.

    For an update with several parts, there will be a .bin and .dat file pair for each part of the update. Then the manifest.json will tell what files belong to what part.

    So in short, if you generate the zip package using nrfutil then you should be good. What version of nrfutil are you using?

    Regards,
    Terje

Reply
  • Hi,

    The init file is generated when you generate the zip package, yes.

    For an update with just one part (either application, softdevice or bootloader) you should get three files in the zip. There should be a .bin file, which is the binary for the firmware update. There should be a .dat file, which is the init packet. There should be a manifest.json, which states what kind of update it is, and list the bin file and dat file.

    For an update with several parts, there will be a .bin and .dat file pair for each part of the update. Then the manifest.json will tell what files belong to what part.

    So in short, if you generate the zip package using nrfutil then you should be good. What version of nrfutil are you using?

    Regards,
    Terje

Children
Related