Programming nRF52840 with nrfutil DFU

Hi, 

I've a firmware built using SoftDevice S140 and I can program it fine on nRF52840 dongle using nRF Connect programmer application. 

Now I'm trying to achieve the same using nrfutil but have so far failed. For some odd reason nrfutil does not seem to program the SoftDevice at all  but only the application (or writes the application over SoftDevice?). I'm using nrfutil 6.1.6 and nRF5_SDK_17.1.0_ddde560.

Is there something obviously wrong with my commands? These hex files work fine when used with nRF Connect programmer.

$ nrfutil pkg generate --hw-version 52 --sd-req 0x00 --sd-id=0x100 --softdevice s140_nrf52_7.2.0_softdevice.hex --application ble_app_hid_composite_bridge_pca10059_s140.hex --application-version 1 dfu.zip


Package appears fine.

$ nrfutil pkg display dfu.zip

DFU Package: <dfu.zip>:
|
|- Image count: 2
|
|- Image #0:
|- Type: softdevice
|- Image file: s140_nrf52_7.2.0_softdevice.bin
|- Init packet file: s140_nrf52_7.2.0_softdevice.dat
|
|- op_code: INIT
|- signature_type: UNSIGNED
|- signature (little-endian): N/A
|
|- fw_version: 0xFFFFFFFF (4294967295)
|- hw_version 0x00000034 (52)
|- sd_req: 0x00, 0x100
|- type: SOFTDEVICE
|- sd_size: 153140
|- bl_size: 0
|- app_size: 0
|
|- hash_type: SHA256
|- hash (little-endian): b'd2af0ef71c6b009b727ccec580f949c19af7024c644ee11121cac5d010f02a19'
|
|- boot_validation_type: ['VALIDATE_GENERATED_CRC']
|- boot_validation_signature (little-endian): [b'']
|
|- is_debug: False

|
|- Image #1:
|- Type: application
|- Image file: ble_app_hid_composite_bridge_pca10059_s140.bin
|- Init packet file: ble_app_hid_composite_bridge_pca10059_s140.dat
|
|- op_code: INIT
|- signature_type: UNSIGNED
|- signature (little-endian): N/A
|
|- fw_version: 0x00000001 (1)
|- hw_version 0x00000034 (52)
|- sd_req: 0x00, 0x100
|- type: APPLICATION
|- sd_size: 0
|- bl_size: 0
|- app_size: 39260
|
|- hash_type: SHA256
|- hash (little-endian): b'313862386fd0a94e3ffecb674b43173027d2c9771c7c68e1fd60af3e0c82eb4c'
|
|- boot_validation_type: ['VALIDATE_GENERATED_CRC']
|- boot_validation_signature (little-endian): [b'']
|
|- is_debug: False

And the programming succeeds.

$ nrfutil dfu usb-serial -pkg dfu.zip -p COM10 -b 115200

Device programmed.


However dongle does not boot. nRF Connect programmer it shows that there is only the application and that the Softdevice is missing.



Flash looks like this when programmed correctly with nRF Connect.

Related