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

NRF51822: Updating Bootloader via DFU OTA

Hi All,

I am trying to update the existing Bootloader on my product with the new Bootloader via OTA DFU. I have searched the forum for similar posts and succeeded in creating the zip file with the Bootloader file. But while updating the Bootloader via NRFTOOLBOX app, the dfu prices starts and immediately the device gets disconnected with invalid object error.

I am using the following statement for creating the zip file

Nrfutil dfu genpkg fw_bootloader.zip --bootloader nrf51422_xxac_s130.hex --application-version 0xff --dev-revision 2 --dev-type 51 --sd-req 0x87

Then the zip file is created successfully but while updating the device gets disconnected with the invalid object error

Please help us to resolve the issue at the earliest

Best,

Krish

  • Hello,

    What SDK version and which bootloader project is your bootloader based on?

    Do you use a keyset (private key and public key)?

    Have you tried to just update the application? Does that work?

    Best regards,

    Edvin

  • SDK is 12.2.0 and I'm using secure bootloader 

    I have set the keyset for updating the application and able to update the application via DFU successfully.

    This issue is only when updating the Bootloader.

  • You need to sign this packet as well with the private key, just as you do with the application.

    nrfutil dfu genpkg fw_bootloader.zip --bootloader nrf51422_xxac_s130.hex --application-version 0xff --dev-revision 2 --dev-type 51 --sd-req 0x87

    I can't see that you do it here. I don't remember the syntax to this version of nrfutil (It is a bit old, and the new doesn't have the "nrfutil dfu genpkg" option anymore. But since you know how to add keys to the application, it should be the same for the bootloader pkg. 

    BR,

    Edvin

  • Hi Edvin,

    Thanks for the quick reply. I have tried using the same command for creating the bootloader zip that includes key but unfortunately it didn't work, I am getting error and not able to generate the zip file.

    It would be great if you can please provide the proper syntax to generate the zip file with key. Also send me the new syntax to generate the zip file, I'll try that as well.

    Thanks,

    Krish

  • Hello Krish,

    Can you try the following: update to the latest version of nrfutil(version 4.0.0). It can be found here.

    Then try to generate the bootloader packet using the following command:

    nrfutil pkg generate --bootloader bl.hex --bootloader-version 2 --hw-version 51 --sd-req 0x87 --key-file keys\private.key DFU_bl_test1.zip

    Of course, you need to change the paths to the bootloader hex file, as well as the private key file.

    You can use either nRF Connect or nrfutil to perform the DFU. In nRF Connect, you just press the DFU button after connecting, if you use nrfutil, you can use the following:

    nrfutil dfu ble -pkg DFU_bl_test1.zip -ic NRF5X -n DfuTarg -p COMN -snr xxxxxxxxx -f

    Change NRF5X with either NRF51 or NRF52 (the DK that you use for the transfer, the connectivity device, not the one containing the bootloader).

    Change COMN to the COM port of your connectivity device.

    Change -snr xxxxxxxx with the Segger ID of your connectivity device.

    Best regards,

    Edvin

Related