BLE DFU failed "Error: selected firmware is not compatible with the device"

Hi,

I have successfully compiled and flashed secure_bootloader_ble_s140

i compiled ble_app_buttonless_dfu as a combo hex (merged along with bootloader) and flashed on the target. App name is app_v1.hex in this case

:: create bootloader settings
nrfutil settings generate --family NRF52840 --application app_v1.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 settings.hex

:: flash the bootloader along with app_v1
mergehex -m app_v1.hex bl.hex s140.hex settings.hex -o image_combo.hex

nrfjprog -f nrf52 --recover
nrfjprog --program image_combo.hex --verify

nrfjprog -f nrf52 --reset

As an app update test, I changed the advertising name in the ble_app_buttonless_dfu to something different than the original and created a update zip package. The new hex name is app_v2.hex in this case

:: generate keys
nrfutil.exe keys generate private.key

:: create an update package with new app (advertising name changed)
nrfutil pkg generate --hw-version 52 --application-version 2 --application app_v2.hex --sd-req 0xAF --key-file private.key update_package.zip

 

but I'm getting below error during DFU pre-validation

I have tried using --debug-mode as well.

Kindly help on the issue at earliest

Environment:

Win 10

Segger Embedded Studio 5.40c

NRF SDK 15.2.0

Softdevice S140 v6.1.0

NRF52840-Preview-DK

nrfutil 7.4.1

Parents Reply Children
  • Hi,

    I have already flashed SD bootloader and bootloader settings by merging them as mentioned earlier

    :: create bootloader settings
    nrfutil settings generate --family NRF52840 --application app_v1.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 settings.hex

    :: flash the bootloader along with app_v1
    mergehex -m app_v1.hex bl.hex s140.hex settings.hex -o image_combo.hex

    The only difference is that I am using production version for secure bootloader and not the debug one. But I guess Im providing custom keys etc so it should pass the validation?

    PFA the attachments

    BR,

    Eshwar

    dfu_package.zip

  • Hi, 

    Do you update the dfu_public_key.c file to the project folder, replacing the existing file?

    You could try to only update the package with only the SD+BL_debug on the device to get more debug information via J-Link RTT. 

    -Amanda H.

  • Hi,

    Thanks for suggesting. I was able to trace two mistakes

    • The dfu_public_key.c had obsolete contents, replaced with freshly generated keys
    • Cross checked with nrfutil pkg generate --help and found that for S140 the firmware id is 0xAE, I was mistaking it for 0xAF which also caused validation to fail

    After these changes were updated, I was successfully able to test the BLE DFU with secure bootloader

    BR,

    Eshwar

Related