Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU FW validation error

Hello,

I am performing a OTA DFU operation with a combined package (Bootloader + Soft Device + Application). The firmware version validation is failing. 

When nrf_dfu_ver_validation() is called, the dru_init_command_t.fw_version field contains the bootloader version (image 0 fw_version), not the version of the application (image 1 fw_version). The nrf_dfu_settings.app_version contains the correct information for the currently installed application so the comparison fails.

Here is a dump of the DFU package.

|
|- Image count: 2
|
|- Image #0:
|- Type: sd_bl
|- Image file: sd_bl.bin
|- Init packet file: sd_bl.dat
|
|- op_code: INIT
|- signature_type: ECDSA_P256_SHA256
|- signature (little-endian): b'008454b635d074e2fa420af6a872268c51e87778702714fb3d215e49c1a287f6a49fdd38d0564ece3b16bc4efd8084a607ba416ed2648ba052c6afb2d4184a14'
|
|- fw_version: 0x00000006 (6)
|- hw_version 0x0000002A (42)
|- sd_req: 0x102, 0xCC, 0x9D
|- type: SOFTDEVICE_BOOTLOADER
|- sd_size: 107692
|- bl_size: 24176
|- app_size: 0
|
|- hash_type: SHA256
|- hash (little-endian): b'2edfb3be03bf637c92bd23fd700175b579de420bcb61c30dd867a79fc1fd774a'
|
|- boot_validation_type: ['VALIDATE_GENERATED_CRC', 'VALIDATE_GENERATED_CRC']
|- boot_validation_signature (little-endian): [b'', b'']
|
|- is_debug: False

|
|- Image #1:
|- Type: application
|- Image file: FIELD_BLE_UART_D045_ETM_v396.bin
|- Init packet file: FIELD_BLE_UART_D045_ETM_v396.dat
|
|- op_code: INIT
|- signature_type: ECDSA_P256_SHA256
|- signature (little-endian): b'8ed7261a47a8c0f9ff55685249a0a4b3c7352c63303d4bde2a0dfb25e8bac1d466d494b7c431bdd858dc9c6abcf3f07c1e4c5dbfad53ed6d191fdc7d51979fd5'
|
|- fw_version: 0x2010396F (537934191)
|- hw_version 0x0000002A (42)
|- sd_req: 0x102
|- type: APPLICATION
|- sd_size: 0
|- bl_size: 0
|- app_size: 161956
|
|- hash_type: SHA256
|- hash (little-endian): b'637dd572d7f8dac1071a95878f24483f1f3382aea3a30eec2f60434a9b577307'
|
|- boot_validation_type: ['VALIDATE_GENERATED_CRC']
|- boot_validation_signature (little-endian): [b'']
|
|- is_debug: False

I am using SDK 17.0.1, soft device S113 7.2.0

Any idea how to fix this?

Thanks

Parents Reply Children
  • I had to modify the SDK source. Don't believe it is fixed in 17.1.0.

    Another issue I discovered is that when you DFU with the "-debug-mode" the boot loader does not save the firmware version if it is less than the last firmware version. This means the next time you DFU without "-debug-mode" that version must be greater than the last non-debug-mode version, not the last firmware version downloaded. Had to change the SDK to fix this too.

    Hope this helps.

  • The NRF_DFU_APP_ACCEPT_SAME_VERSION setting is not meant to apply to bootloader updates, so we have not considered this to be bug. If recall correctly, this was a choice we made to prevent potential attackers from erasing the application by re-sending the init command for a SD+BL update. 

Related