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

DFU update fails with message "INVALID OBJECT"

Hello,


I want to evaluate the ble_app_buttonless_dfu example (C:\nRF5SDK160098a08e\examples\ble_peripheral\ble_app_buttonless_dfu).
I am using the nRF5 SDK 16.0.0, IAR EWARM 7.80 and a nrf52833 board.
That’s what I am doing:


1. generate private key:
nrfutil keys generate private.key


2. generate public key:
nrfutil keys display --key pk --format code private.key --out_file dfu_public_key.c


3. copy dfu_public_key.c to C:\nRF5SDK160098a08e\examples\dfu


4. build the secure_bootloader with IAR using the following project:
secure_bootloader_ble_s132_pca10040.ewp to get: secure_bootloader_ble_s132_pca10040.hex


5. build the ble_app_buttonless_dfu application with IAR using the following project: ble_app_buttonless_dfu_pca10040_s132.ewp to get: ble_app_buttonless_dfu_pca10040_s132.hex


6. generate bootloader settings:
nrfutil settings generate --family NRF52 --application ble_app_buttonless_dfu_pca10040_s132.hex --application-version 1 --bootloader-version 0 --bl-settings-version 1 bootloader_setting.hex


7. merge application, bootloader, softdevice and bootloader-settings:
mergehex --merge s132_nrf52_7.0.1_softdevice.hex ble_app_buttonless_dfu_pca10040_s132.hex secure_bootloader_ble_s132_pca10040.hex bootloader_setting.hex --output my_ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex


8. generate the zip file
nrfutil pkg generate --hw-version 52 --application-version 1 --application ble_app_buttonless_dfu_pca10040_s132.hex --sd-req 0xCB --key-file private.key my_ble_app_buttonless_dfu_without_bonds_s132.zip


8. use nRF Connect/ Programmer to flash my_ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex into the nrf52833


9. Copy my_ble_app_buttonless_dfu_without_bonds_s132.zip to the smartphone and start the nRF Toolbox/DFU, SELECT DEVICE (DfuTarg), SELECT FILE (my_ble_app_buttonless_dfu_without_bonds_s132.zip) and start press UPLOAD. The upload process failed with the following message “INVALID OBJECT”

In the directory C:\nRF5SDK160098a08e\examples\dfu\secure_dfu_test_images\ble\nrf52832
I found 2 files that are working fine.
ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex

ble_app_buttonless_dfu_without_bonds_s132.zip


What do I wrong ? How can I get a working ble_app_buttonless_dfu example out of the source code ?

See my hex- and zip File in the attachment.


Thank you for your support !

my_ble_app_buttonless_dfu_without_bonds_s132.zipmy_ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex

  • Hello,

    I see that you are using your merged .hex file (app, sd and bootlaoder) to generate your dfu image, but your pkg doesn't contain information that it contains the sd and bl.

    Do you intend to update all these? Note that you can update the application only. If you just replace the "my_ble_app_buttonless_dfu_without_bonds_s132" with the "ble_app_buttonless_dfu_pca10040_s132" in your "nrfutil pkg generate ..." command, I think it should be fine.

    If you intentionally want to update the BL and SD as well, you need to keep these separated (don't merge them), and then use the "--sd-id <version>" for the new softdevice, and --softdevice <path to softdevice>, and the same for the bootloader: --bootloader <bootloader .hex> and --bl-version <bootloader version>.

    If you are new to DFU, I suggest you gp through this tutorial:

    https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader

    BR,

    Edvin

  • Hello Edvin,

    thank you for your fast answer.

    I intend only to update the application. 

    Sorry I don't understand your answer, because I built the zip-file out of the application (ble_app_buttonless_dfu_pca10040_s132.hex) and not from he "complete" hex-file (my_ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex) which was made of (APP + BL + SD + BL-setting ).

    The "complete" hex-file (my_ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex) is the file for the production. The customer updates the product by using ble_app_buttonless_dfu_without_bonds_s132.zip

    I have already read the tutorial that you are mentioned.

    APP = ble_app_buttonless_dfu_pca10040_s132.hex

    BL = secure_bootloader_ble_s132_pca10040.hex

    BL-SETTINGS = bootloader_setting.hex

    SD = s132_nrf52_7.0.1.hex

    APP + BL + SD + BL-Settings = my_ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex

     Do you have any ideas what could be the problem ?

    Regards

    Georg

  • Hello,

     

    Georg said:
    Sorry I don't understand your answer, because I built the zip-file out of the application (ble_app_buttonless_dfu_pca10040_s132.hex) and not from he "complete" hex-file (my_ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex) which was made of (APP + BL + SD + BL-setting ).

     Sorry. That is correct. I thought you used the merged image.

    Please ensure that your bootloader is using a dfu_public_key.c that is generated with the private.key that you are using to sign your image.

    If you are still stuck. Have you done any (!) changes to the bootloader project other than changing the dfu_public_key.c?

  • Hallo Edvin

    Thank you for you reply.

    As I described at point 3: I copied dfu_public_key.c to the BL project before building the BL (secure_bootloader_ble_s132_pca10040.hex) .

    I changed only dfu_public_key.c in the example BL project.

    What is the reason for the "invalid object" message ?

    Is there something wrong with the keys or signature ? 

    I looked in the BL map file and I see that the oberon  lib is used. Is this correct  or is uECC-lib the right one ?

    I am using a nrf52832 porject together with  nrf52833 chip, could this be the  problem ?

    I tried a lot of things but I still suck Cry.

    Regards

    Georg

  • Perhaps it doesn't like that you are using the same application-version as you already have. Try generating a new one with --application-version 2, and see if that helps. But I think by default, it should accept same version (application-version). However, it is worth a shot.

     

    Georg said:
    I am using a nrf52832 porject together with  nrf52833 chip, could this be the  problem ?

     I suggest you try using an nRF52833 project. Did you try the pca10100_s140_ble instead of pca10040_s132_ble? Actually, I didn't know until now that you were using the nRF52833. 

    Also, make sure that you use the bootloader.hex file that you have compiled, and not any of the precompiled bootloader .hex files from the SDK.

    In addition, the s132 is not certified with the nRF52833. And I am not sure it will work. Try using either the s140 or s113 projects from the SDK16\examples\dfu\secure_bootloader\pca10100_s1xx_ble.

    Can you please test the armgcc project files? I have not used IAR before, and I am not sure there are any issues with these. I am not saying you need to use it in the end, but since you already have make installed (you should have since you have built the micro-ecc libraries), just call "make" from a command line in the folder SDK\examples\dfu\secure_bootloader\pca10100_s140_ble\armgcc, and use the .hex file generated in the _build folder from that location.

    Best regards,

    Edvin

Related