NRF52840 DFU APP+BL+SD error,DFU request 4 failed with error: 0xB.

hello

1.NRF52840 Upgrade APP+BL+SD  from SD15.3 to SD17.1.

2.BL use pca10056_s140_ble_debug,APP use ble_app_buttonless_dfu.

3.Program batch file.

nrfutil settings generate --application nRF5_SDK_15.3.0_59ac345/examples/ble_peripheral/ble_app_buttonless_dfu/pca10056/s140/arm5_no_packs/_build/nrf52840_xxaa.hex --family NRF52840 --application-version 0 --bootloader-version 0 --bl-settings-version 2 settings.hex
nrfjprog --eraseall -f NRF52
nrfjprog --program settings.hex --chiperase
nrfjprog --program bootloader_hex/bootloader_w_softdevice_nrf52840.hex
nrfjprog --program nRF5_SDK_15.3.0_59ac345/examples/ble_peripheral/ble_app_buttonless_dfu/pca10056/s140/arm5_no_packs/_build/nrf52840_xxaa.hex -r

4.DFU packag batch file.

nrfutil pkg generate --hw-version 52 --sd-req 0xB6,0x0100 --application-version 1 --application nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_buttonless_dfu/pca10056/s140/arm5_no_packs/_build/nrf52840_xxaa.hex --softdevice nRF5_SDK_17.1.0_ddde560/components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex --bootloader nRF5_SDK_17.1.0_ddde560/examples/dfu/secure_bootloader/pca10056_s140_ble_debug/arm5_no_packs/_build/nrf52840_xxaa_s140.hex --bootloader-version 1 --sd-id 0x0100 --key-file priv.pem dfu_15.3-17.1.zip.

5.Android APP nRD Connect DFU.

6.The RTT print error.


<debug> nrf_dfu_validation: 08 01 10 34 1A 02 80 02|...4....

<debug> nrf_dfu_validation: 20 00 28 00 30 00 38 84| .(.0.8.

<debug> nrf_dfu_validation: A4 03 42 24 08 03 12 20|..B$...

<debug> nrf_dfu_validation: 60 14 FA A9 4A D5 1E CE|`...J...

<debug> nrf_dfu_validation: E9 16 D8 8F A7 DE FC 41|.......A

<debug> nrf_dfu_validation: 12 32 92 3F CE 95 32 B8|.2.?..2.

<debug> nrf_dfu_validation: 08 25 48 60 4E 22 65 CA|.%H`N"e.

<debug> nrf_dfu_validation: 48 00 52 04 08 01 12 00|H.R.....

<debug> nrf_dfu_req_handler: Request handling complete. Result: 0xB

<warning> nrf_dfu_ble: DFU request 4 failed with error: 0xB.

Parents Reply
  • Hi,

    The key information from the log are these lines:

    <warning> nrf_dfu_ver_validation: Faulty HW version.
    <warning> nrf_dfu_validation: Prevalidation failed.

    So the HW version specified in the upgrade image (that was set with the --hw-version option for nrfutil) does not match the HW version specified in the bootloader's sdk_config.h with the NRF_DFU_HW_VERSION define. As this is not the same, the upgrade is aborted.

Children
  • 1.The hardware version in SDK15.3 and SDK17.1 are as follow.

    #ifndef NRF_DFU_HW_VERSION
    #define NRF_DFU_HW_VERSION 52
    #endif

    2.How to solve this problem?

    Thanks.

  • This is the batch file that genrates the upgrade packege.

    nrfutil pkg generate --hw-version 52 --sd-req 0xB6 --application-version 2 --application nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_buttonless_dfu/pca10056/s140/arm5_no_packs/_build/nrf52840_xxaa.hex --softdevice nRF5_SDK_17.1.0_ddde560/components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex --bootloader nRF5_SDK_17.1.0_ddde560/examples/dfu/secure_bootloader/pca10056_s140_ble_debug/arm5_no_packs/_build/nrf52840_xxaa_s140.hex --bootloader-version 2 --sd-id 0x0100 --key-file priv.pem dfu_15.3-17.1.zip

  • Can you tripple check? Looking at the code, I am not able to see any other explanation for this. The error is printed from this snippet in the bootloader:

            else if (p_init->hw_version != NRF_DFU_HW_VERSION)
            {
                NRF_LOG_WARNING("Faulty HW version.");
                ret_val = EXT_ERR( NRF_DFU_EXT_ERROR_HW_VERSION_FAILURE);
            }

    Are you sure the bootloader that is running was built with NRF_DFU_HW_VERSION set to 52? Did you program it now, or could it be that it does not run the bootloader you think it does?

    And regarding the DFU image, could it have been a mixup? Can you check the zip file using "nrfutil pkg display <file>"?

  • 1.NRF_DFU_HW_VERSION default value is 52,unchanged.

    2.nrfutil pkg display as follows.

    PS F:\DFU\DFU_BLE-17.1> nrfutil pkg display dfu_15.3-17.1.zip
    
    DFU Package: <dfu_15.3-17.1.zip>:
    |
    |- 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'd9a8e3299fa1635bae74cc8433f06876c3f51a8d495ae60aec834620120ef8f1d6974ff5a11ab3b8e24ef2ddefa6298b32986319ab3cc194fa46b6b9e5cb8d28'
          |
          |- fw_version: 0x00000002 (2)
          |- hw_version 0x00000034 (52)
          |- sd_req: 0x100, 0xB6
          |- type: SOFTDEVICE_BOOTLOADER
          |- sd_size: 153140
          |- bl_size: 54452
          |- app_size: 0
          |
          |- hash_type: SHA256
          |- hash (little-endian): b'0a7f3e043cddef1e568a9eb01a623a24191306ce61a53e1606330e2205a39985'
          |
          |- 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: nrf52840_xxaa.bin
       |- Init packet file: nrf52840_xxaa.dat
          |
          |- op_code: INIT
          |- signature_type: ECDSA_P256_SHA256
          |- signature (little-endian): b'870749823a8acbea22de7aaf6f7f5d03f41ab8d3e5a97d3b5279bbc65fa682796c4443b1821ad0f7f87f9d5b626a6a093983cf2e09dc979acf8e653ca51a57b7'
          |
          |- fw_version: 0x00000002 (2)
          |- hw_version 0x00000034 (52)
          |- sd_req: 0x100
          |- type: APPLICATION
          |- sd_size: 0
          |- bl_size: 0
          |- app_size: 53764
          |
          |- hash_type: SHA256
          |- hash (little-endian): b'd96f871639b078031f3b65ba7dd65667c9027e48a1c14fe383c7418665a228eb'
          |
          |- boot_validation_type: ['VALIDATE_GENERATED_CRC']
          |- boot_validation_signature (little-endian): [b'']
          |
          |- is_debug: False

  • Hm, that is most peculiar. Perhaps you can modify the bootloader and log a bit more. First of all, start with components/libraries/bootloader/dfu/nrf_dfu_ver_validation.c and the section I posted in my previous reply. Then print both p_init->hw_version and NRF_DFU_HW_VERSION separately to see which value they have there. Clearly they are not the same in this check, so it would be good to know which of them have a different value, and what that is. Then we can continue from there.

Related