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

DFU (no bonding) getting stuck

I'm attempting to perform DFU with the secure bootloader (bonding not required) and it is hanging after starting the update. Here's the log from the firmware (SDK 16.0.0):

[00:01:46.668,151] <info> app: dfu
[00:01:46.713,500] <info> app: dfu
[00:01:46.758,117] <info> Bluetooth: Device is preparing to enter bootloader mode.
[00:01:46.758,239] <info> Bluetooth: Disconnected 1 links.
[00:01:46.758,422] <debug> app: In ble_dfu_buttonless_boog forbidden parts from backup page.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
<debug> nrf_dfu_settings: Writing settings...
<debug> nrf_dfu_settings: Erasing old settings at: 0x0007E000
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007E000, len=1 pages), queue usage: 0
<debug> nrf_dfu_flash: Flash erase success: addr=0x0007E000, pending 0
<debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007E000, src=0x200064D4, len=896 bytes), queue usage: 1
<debug> nrf_dfu_flash: Flash write success: addr=0x0007E000, pending 0
<debug> app: Enter nrf_bootloader_fw_activate
<info> app: No firmware to activate.
<debug> app: App is valid
<debug> app: DFU mode requested via GPREGRET.
<info> nrf_bootloader_wdt: WDT is not enabled
<debug> app: in weak nrf_dfu_init_user
<debug> app: timer_stop (0x200037DC)
<debug> app: timer_activate (0x200037DC)
<info> app: Entering DFU mode.
<debug> bootloader: DFU Initialised
<debug> app: Initializing transports (found: 1)
<debug> nrf_dfu_ble: Initializing BLE DFU transport
<debug> nrf_dfu_ble: Setting up vector table: 0x00072000
<debug> nrf_dfu_ble: Enabling SoftDevice.
<debug> nrf_dfu_ble: Configuring BLE stack.
<debug> nrf_dfu_ble: Enabling the BLE stack.
<debug> nrf_dfu_ble: Setting adv name: Dfu68292, length: 8
<debug> nrf_dfu_ble: Advertising...
<debug> nrf_dfu_ble: BLE DFU transport initialized.
<debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
<debug> app: Enter main loop
<debug> nrf_dfu_ble: Connected
<debug> bootloader: DFU Transport activated
<debug> nrf_dfu_ble: Received BLE_GAP_EVT_CONN_PARAM_UPDATE
<debug> nrf_dfu_ble: max_conn_interval: 12
<debug> nrf_dfu_ble: min_conn_interval: 12
<debug> nrf_dfu_ble: slave_latency: 0
<debug> nrf_dfu_ble: conn_sup_timeout: 600
<debug> nrf_dfu_ble: Received BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST.
<debug> nrf_dfu_ble: Received BLE_GAP_EVT_DATA_LENGTH_UPDATE (251, max_rx_time 2120).
<debug> nrf_dfu_ble: Received BLE_GAP_EVT_PHY_UPDATE_REQUEST.
<debug> nrf_dfu_ble: Received BLE_GAP_EVT_PHY_UPDATE (RX:2, TX:2, status:0)
<debug> nrf_dfu_ble: Received BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST (request: 527, reply: 247).
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (command)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> app: Shutting down transports (found: 1)
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
<debug> app: timer_stop (0x200037DC)
<debug> app: timer_activate (0x200037DC)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Set receipt notif
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_RECEIPT_NOTIF_SET
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200050B8 acquired, len 144 (244)
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200050B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
<debug> nrf_dfu_validation: PB: Init packet data len: 67
<info> nrf_dfu_validation: Signature required. Checking signature.
<info> nrf_dfu_validation: Calculating hash (len: 67)
<info> nrf_dfu_validation: Verify signature
<info> nrf_dfu_validation: Image verified
<debug> app: Enter nrf_dfu_cache_prepare()
<debug> app: required_size: 0x4C000.
<debug> app: single_bank: false.
<debug> app: keep_app: false.
<debug> app: keep_softdevice: true.
<debug> app: SD_PRESENT: true.
<debug> app: Bank contents:
<debug> app: Bank 0 code: 0x01: Size: 0x4C000
<debug> app: Bank 1 code: 0x00: Size: 0x0
<debug> app: pass: 0.
<debug> app: cache_address: 0x72000.
<debug> app: cache_too_small: false.
<debug> app: keep_firmware: false.
<debug> app: delete_more: false.
<debug> nrf_dfu_validation: Write address set to 0x00072000
<debug> nrf_dfu_settings: Writing settings...
<debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
<debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, src=0x20006154, len=896 bytes), queue usage: 2
<info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
<debug> nrf_dfu_settings: Writing settings...
<debug> nrf_dfu_settings: Erasing old settings at: 0x0007E000
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007E000, len=1 pages), queue usage: 3
<debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007E000, src=0x200064D4, len=896 bytes), queue usage: 4
<debug> nrf_dfu_req_handler: Writing valid init command to flash.
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Set receipt notif
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_RECEIPT_NOTIF_SET
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 4
<debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 3
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (data)
<debug> nrf_dfu_req_handler: crc = 0x0, offset = 0x0, max_size = 0x1000
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_flash: Flash erase success: addr=0x0007E000, pending 2
<debug> nrf_dfu_flash: Flash write success: addr=0x0007E000, pending 1
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (data)
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x00072000, len=1 pages), queue usage: 1
<debug> nrf_dfu_req_handler: Creating object with size: 4096. Offset: 0x00000000, CRC: 0x00000000
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1

Here's the log from the App (using nordic iOS DFU library, master branch or 4.8.0):

2020-08-16 23:17:19.994156+0100 [console] Performing DFU update
2020-08-16 23:17:19.994581+0100 [console] Performing DFU
2020-08-16 23:17:20.904301+0100 [bluetooth] DFU log [Callback] Central Manager did update state to: Powered ON
2020-08-16 23:17:20.904400+0100 [bluetooth] DFU log Connecting to DevKit...
2020-08-16 23:17:20.904460+0100 [bluetooth] DFU log centralManager.connect(peripheral, options: nil)
2020-08-16 23:17:20.904918+0100 [bluetooth] DFU log [Callback] Central Manager did connect peripheral
2020-08-16 23:17:20.904980+0100 [bluetooth] DFU log Connected to DevKit
2020-08-16 23:17:20.905028+0100 [console] DFU log: Connected to DevKit
2020-08-16 23:17:20.905171+0100 [bluetooth] DFU log Discovering services...
2020-08-16 23:17:20.905223+0100 [bluetooth] DFU log peripheral.discoverServices(nil)
2020-08-16 23:17:20.912326+0100 [bluetooth] DFU log Services discovered
2020-08-16 23:17:20.912426+0100 [console] DFU log: Services discovered
2020-08-16 23:17:20.912549+0100 [bluetooth] DFU log Starting Secure DFU...
2020-08-16 23:17:20.912600+0100 [bluetooth] DFU log Connected to DevKit
2020-08-16 23:17:20.912647+0100 [console] DFU log: Connected to DevKit
2020-08-16 23:17:20.912720+0100 [bluetooth] DFU log Services discovered
2020-08-16 23:17:20.912765+0100 [console] DFU log: Services discovered
2020-08-16 23:17:20.912821+0100 [bluetooth] DFU log Secure DFU Service found
2020-08-16 23:17:20.912868+0100 [bluetooth] DFU log Discovering characteristics in DFU Service...
2020-08-16 23:17:20.913067+0100 [bluetooth] DFU log peripheral.discoverCharacteristics(nil, for: FE59)
2020-08-16 23:17:20.915473+0100 [bluetooth] DFU log DFU characteristics discovered
2020-08-16 23:17:20.915540+0100 [console] DFU log: DFU characteristics discovered
2020-08-16 23:17:20.915624+0100 [bluetooth] DFU log Enabling indications for 8EC90003-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:20.915673+0100 [bluetooth] DFU log peripheral.setNotifyValue(true, for: 8EC90003-F315-4F60-9FB8-838830DAEA50)
2020-08-16 23:17:20.961260+0100 [bluetooth] DFU log Indications enabled for 8EC90003-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:20.961354+0100 [bluetooth] DFU log Buttonless DFU indications enabled
2020-08-16 23:17:20.961399+0100 [bluetooth] DFU log Application with buttonless update found
2020-08-16 23:17:20.961449+0100 [console] DFU log: Application with buttonless update found
2020-08-16 23:17:20.961564+0100 [bluetooth] DFU log Trying setting bootloader name to Dfu68292
2020-08-16 23:17:20.961614+0100 [bluetooth] DFU log Writing to characteristic 8EC90003-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:20.961655+0100 [bluetooth] DFU log peripheral.writeValue(0x02084466753638323932, for: 8EC90003-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:21.002538+0100 [bluetooth] DFU log Data written to 8EC90003-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:21.002625+0100 [console] DFU log: Data written to 8EC90003-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:21.002737+0100 [bluetooth] DFU log Indication received from 8EC90003-F315-4F60-9FB8-838830DAEA50, value (0x):200201
2020-08-16 23:17:21.002790+0100 [console] DFU log: Indication received from 8EC90003-F315-4F60-9FB8-838830DAEA50, value (0x):200201
2020-08-16 23:17:21.002857+0100 [bluetooth] DFU log Response (Op Code = 2, Status = 1) received
2020-08-16 23:17:21.002904+0100 [bluetooth] DFU log Bootloader name changed successfully
2020-08-16 23:17:21.002947+0100 [bluetooth] DFU log Writing to characteristic 8EC90003-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:21.002996+0100 [bluetooth] DFU log peripheral.writeValue(0x01, for: 8EC90003-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:21.047086+0100 [bluetooth] DFU log Data written to 8EC90003-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:21.047193+0100 [console] DFU log: Data written to 8EC90003-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:21.047311+0100 [bluetooth] DFU log Indication received from 8EC90003-F315-4F60-9FB8-838830DAEA50, value (0x):200101
2020-08-16 23:17:21.047364+0100 [console] DFU log: Indication received from 8EC90003-F315-4F60-9FB8-838830DAEA50, value (0x):200101
2020-08-16 23:17:21.047427+0100 [bluetooth] DFU log Response (Op Code = 1, Status = 1) received
2020-08-16 23:17:21.799644+0100 [console] App: orgs this must ions am bulk: Device disconnected
2020-08-16 23:17:21.800709+0100 [bluetooth] DFU log [Callback] Central Manager did disconnect peripheral
2020-08-16 23:17:21.800975+0100 [bluetooth] DFU log Disconnected by the remote device
2020-08-16 23:17:21.801146+0100 [console] DFU log: Disconnected by the remote device
2020-08-16 23:17:21.801508+0100 [bluetooth] DFU log Buttonless service not configured, see: https://devzone.nordicsemi.com/f/nordic-q-a/59881/advertising-rename-feature-not-working/243566#243566. To workaround, disable alternative advertising name.
2020-08-16 23:17:21.801721+0100 [console] DFU log: Buttonless service not configured, see: https://devzone.nordicsemi.com/f/nordic-q-a/59881/advertising-rename-feature-not-working/243566#243566. To workaround, disable alternative advertising name.
2020-08-16 23:17:21.802126+0100 [bluetooth] DFU log Scanning for the DFU Bootloader...
2020-08-16 23:17:21.845501+0100 [bluetooth] DFU log DFU Bootloader found with name Dfu68292
2020-08-16 23:17:21.845656+0100 [console] DFU log: DFU Bootloader found with name Dfu68292
2020-08-16 23:17:21.845846+0100 [bluetooth] DFU log Connecting to Dfu36055...
2020-08-16 23:17:21.845951+0100 [bluetooth] DFU log centralManager.connect(peripheral, options: nil)
2020-08-16 23:17:22.494593+0100 [bluetooth] DFU log [Callback] Central Manager did connect peripheral
2020-08-16 23:17:22.494982+0100 [bluetooth] DFU log Connected to Dfu36055
2020-08-16 23:17:22.495200+0100 [console] DFU log: Connected to Dfu36055
2020-08-16 23:17:22.495689+0100 [bluetooth] DFU log Discovering services...
2020-08-16 23:17:22.495943+0100 [bluetooth] DFU log peripheral.discoverServices([FE59])
2020-08-16 23:17:22.566714+0100 [bluetooth] DFU log Services discovered
2020-08-16 23:17:22.566918+0100 [console] DFU log: Services discovered
2020-08-16 23:17:22.567077+0100 [bluetooth] DFU log Secure DFU Service found
2020-08-16 23:17:22.567152+0100 [bluetooth] DFU log Discovering characteristics in DFU Service...
2020-08-16 23:17:22.567209+0100 [bluetooth] DFU log peripheral.discoverCharacteristics(nil, for: FE59)
2020-08-16 23:17:22.576711+0100 [bluetooth] DFU log DFU characteristics discovered
2020-08-16 23:17:22.576824+0100 [console] DFU log: DFU characteristics discovered
2020-08-16 23:17:22.576961+0100 [bluetooth] DFU log MTU set to 247
2020-08-16 23:17:22.577040+0100 [bluetooth] DFU log Enabling notifications for 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.577098+0100 [bluetooth] DFU log peripheral.setNotifyValue(true, for: 8EC90001-F315-4F60-9FB8-838830DAEA50)
2020-08-16 23:17:22.596964+0100 [bluetooth] DFU log Notifications enabled for 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.597072+0100 [bluetooth] DFU log Secure DFU Control Point notifications enabled
2020-08-16 23:17:22.597123+0100 [bluetooth] DFU log Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.597171+0100 [bluetooth] DFU log peripheral.writeValue(0x0601, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:22.629492+0100 [bluetooth] DFU log Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.629582+0100 [console] DFU log: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.629697+0100 [bluetooth] DFU log Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600601000200000000000000000000
2020-08-16 23:17:22.629757+0100 [console] DFU log: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600601000200000000000000000000
2020-08-16 23:17:22.629821+0100 [bluetooth] DFU log Command object info (Max size = 512, Offset = 0, CRC = 00000000) received
2020-08-16 23:17:22.629874+0100 [bluetooth] DFU log Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.629916+0100 [bluetooth] DFU log peripheral.writeValue(0x010190000000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:22.662114+0100 [bluetooth] DFU log Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.662208+0100 [console] DFU log: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.662314+0100 [bluetooth] DFU log Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
2020-08-16 23:17:22.662367+0100 [console] DFU log: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
2020-08-16 23:17:22.662438+0100 [bluetooth] DFU log Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.662485+0100 [bluetooth] DFU log peripheral.writeValue(0x020000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:22.689746+0100 [bluetooth] DFU log Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.689842+0100 [console] DFU log: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.689974+0100 [bluetooth] DFU log Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600201
2020-08-16 23:17:22.690023+0100 [console] DFU log: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600201
2020-08-16 23:17:22.690094+0100 [bluetooth] DFU log Packet Receipt Notif disabled (Op Code = 2, Value = 0)
2020-08-16 23:17:22.690143+0100 [bluetooth] DFU log Writing to characteristic 8EC90002-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.690194+0100 [bluetooth] DFU log peripheral.writeValue(0x128d010a4708011243089c4e10341a04cb01b70120002800300038808013422408031220f2c798b2148ff919887161003a1cc3ebb555a926b1f7b5129a7f1cc9f1df9e58480052040800120010001a40c266240fa94ecd797bf0f0374c6870b786d9509e601454601aa4da8f6bfd9936a211eacf29747bfa3a249f5628c5c8c139b6a75b51c641daa6150187f4e0c853, for: 8EC90002-F315-4F60-9FB8-838830DAEA50, type: .withoutResponse)
2020-08-16 23:17:22.690243+0100 [bluetooth] DFU log Command object sent (CRC = E0205648)
2020-08-16 23:17:22.690284+0100 [bluetooth] DFU log Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.690331+0100 [bluetooth] DFU log peripheral.writeValue(0x03, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:22.713634+0100 [bluetooth] DFU log Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.713722+0100 [console] DFU log: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.713839+0100 [bluetooth] DFU log Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 60030190000000485620e0
2020-08-16 23:17:22.713888+0100 [console] DFU log: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 60030190000000485620e0
2020-08-16 23:17:22.713960+0100 [bluetooth] DFU log Checksum (Offset = 144, CRC = E0205648) received
2020-08-16 23:17:22.714013+0100 [bluetooth] DFU log Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.714060+0100 [bluetooth] DFU log peripheral.writeValue(0x04, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:22.746499+0100 [bluetooth] DFU log Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.746591+0100 [console] DFU log: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.896759+0100 [bluetooth] DFU log Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600401
2020-08-16 23:17:22.896851+0100 [console] DFU log: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600401
2020-08-16 23:17:22.896964+0100 [bluetooth] DFU log Command object executed
2020-08-16 23:17:22.897017+0100 [bluetooth] DFU log Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.897066+0100 [bluetooth] DFU log peripheral.writeValue(0x020c00, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:22.923305+0100 [bluetooth] DFU log Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.923397+0100 [console] DFU log: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:22.923507+0100 [bluetooth] DFU log Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600201
2020-08-16 23:17:22.923566+0100 [console] DFU log: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600201
2020-08-16 23:17:22.923637+0100 [bluetooth] DFU log Packet Receipt Notif enabled (Op Code = 2, Value = 12)
2020-08-16 23:17:22.923680+0100 [bluetooth] DFU log Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:22.923729+0100 [bluetooth] DFU log peripheral.writeValue(0x0602, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:23.047539+0100 [bluetooth] DFU log Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:23.047621+0100 [console] DFU log: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:23.047726+0100 [bluetooth] DFU log Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600601001000000000000000000000
2020-08-16 23:17:23.047776+0100 [console] DFU log: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600601001000000000000000000000
2020-08-16 23:17:23.047838+0100 [bluetooth] DFU log Data object info (Max size = 4096, Offset = 0, CRC = 00000000) received
2020-08-16 23:17:23.047887+0100 [bluetooth] DFU log Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
2020-08-16 23:17:23.047926+0100 [bluetooth] DFU log peripheral.writeValue(0x010200100000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
2020-08-16 23:17:23.165069+0100 [bluetooth] DFU log Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:23.165187+0100 [console] DFU log: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
2020-08-16 23:17:23.173983+0100 [bluetooth] DFU log Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
2020-08-16 23:17:23.174070+0100 [console] DFU log: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
2020-08-16 23:17:23.174167+0100 [bluetooth] DFU log Data object 1/76 created
2020-08-16 23:17:23.174221+0100 [console] DFU log: Data object 1/76 created
2020-08-16 23:17:23.174285+0100 [bluetooth] DFU log wait(400
2020-08-16 23:17:23.596183+0100 [bluetooth] DFU log Uploading firmware...
2020-08-16 23:17:23.596295+0100 [bluetooth] DFU log Sending firmware to DFU Packet characteristic...
2020-08-16 23:17:23.596399+0100 [console] DFU progress:  1 of  1,   0%, 0bps
2020-08-16 23:17:29.218923+0100 [bluetooth] DFU log [Callback] Central Manager did disconnect peripheral
2020-08-16 23:17:29.219268+0100 [bluetooth] DFU log Disconnected by the remote device
2020-08-16 23:17:29.219473+0100 [console] DFU log: Disconnected by the remote device
2020-08-16 23:17:29.219973+0100 [bluetooth] DFU log Connecting to Dfu36055...
2020-08-16 23:17:29.220289+0100 [bluetooth] DFU log centralManager.connect(peripheral, options: nil)
2020-08-16 23:17:39.219751+0100 [bluetooth] DFU log Connection timeout!
2020-08-16 23:17:39.220520+0100 [console] DFU log: Connection timeout!
2020-08-16 23:17:39.221526+0100 [bluetooth] DFU log centralManager.cancelPeripheralConnection(peripheral)
2020-08-16 23:17:39.284591+0100 [bluetooth] DFU log [Callback] Central Manager failed to connect to peripheral (timeout)
2020-08-16 23:17:39.284722+0100 [console] DFU log: [Callback] Central Manager failed to connect to peripheral (timeout)
2020-08-16 23:17:39.284883+0100 [console] DFU Error: Device failed to connect

Any idea why?

Parents
  • Hello,

    In case you are using Segger embedded studio and have made changes to the bootloader that may have increased the code size, please try to re-compile the bootloader with the updated flash_placement.xml file from SDK 17.0.0 as I recommend here: https://devzone.nordicsemi.com/f/nordic-q-a/64730/micro-ecc-a-file-not-included/264581#264581.The original one will not give you a linker warning even if the bootloader starts to overlap with the MBR params page, which may result in the behavior you described.

    Best regards,

    Vidar

  • I don't think this is the issue. I'm using armgcc. My App linker file looks like this:

    MEMORY
    {
        /* MBR_FLASH (rx)        : ORIGIN = 0x00000000, LENGTH = 0x00001000 */
        /* SOFTDEVICE_FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 0x00025000 */
    
        FLASH (rx)               : ORIGIN = 0x00026000, LENGTH = 0x0004b000
        RAM (rwx)                : ORIGIN = 0x20003320, LENGTH = 0x0000cce0
    
        provisioning_data (rwx)  : ORIGIN = 0x00071000, LENGTH = 0x00001000
    
        /* BOOTLOADER_FLASH (rx) : ORIGIN 0x00072000, LENGTH = 0x0000c000 */
    }

    % arm-none-eabi-size FirmwareProject_DevKit.elf
       text    data     bss     dec     hex filename
     271608    7360   26880  305848   4aab8 FirmwareProject_DevKit.elf
    

    Bootloader looks like this:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x72000, LENGTH = 0xc000
      RAM (rwx) :  ORIGIN = 0x20003320, LENGTH = 0xcce0
      uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
      bootloader_settings_page (r) : ORIGIN = 0x0007F000, LENGTH = 0x1000
      uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
      mbr_params_page (r) : ORIGIN = 0x0007E000, LENGTH = 0x1000
    }

    % arm-none-eabi-size bootloader.out
       text    data     bss     dec     hex filename
      44660    1400   22436   68496   10b90 bootloader.out
    

    So addresses are

    0x26000-0x71000 Firmware

    0x71000-0x72000 Reserved flash storage

    0x72000-0x7E000 Bootloader

    0x7E000-0x7F000 mbr params

    0x7F000-0x80000 bootloader settings

    firmware size 271608 < flash space 0x4b000 = 307200

    bootloader size 44660 < flash space 0xc000 = 49152

    I've just tried 17.0.0 and it has the same issue.

Reply
  • I don't think this is the issue. I'm using armgcc. My App linker file looks like this:

    MEMORY
    {
        /* MBR_FLASH (rx)        : ORIGIN = 0x00000000, LENGTH = 0x00001000 */
        /* SOFTDEVICE_FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 0x00025000 */
    
        FLASH (rx)               : ORIGIN = 0x00026000, LENGTH = 0x0004b000
        RAM (rwx)                : ORIGIN = 0x20003320, LENGTH = 0x0000cce0
    
        provisioning_data (rwx)  : ORIGIN = 0x00071000, LENGTH = 0x00001000
    
        /* BOOTLOADER_FLASH (rx) : ORIGIN 0x00072000, LENGTH = 0x0000c000 */
    }

    % arm-none-eabi-size FirmwareProject_DevKit.elf
       text    data     bss     dec     hex filename
     271608    7360   26880  305848   4aab8 FirmwareProject_DevKit.elf
    

    Bootloader looks like this:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x72000, LENGTH = 0xc000
      RAM (rwx) :  ORIGIN = 0x20003320, LENGTH = 0xcce0
      uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
      bootloader_settings_page (r) : ORIGIN = 0x0007F000, LENGTH = 0x1000
      uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
      mbr_params_page (r) : ORIGIN = 0x0007E000, LENGTH = 0x1000
    }

    % arm-none-eabi-size bootloader.out
       text    data     bss     dec     hex filename
      44660    1400   22436   68496   10b90 bootloader.out
    

    So addresses are

    0x26000-0x71000 Firmware

    0x71000-0x72000 Reserved flash storage

    0x72000-0x7E000 Bootloader

    0x7E000-0x7F000 mbr params

    0x7F000-0x80000 bootloader settings

    firmware size 271608 < flash space 0x4b000 = 307200

    bootloader size 44660 < flash space 0xc000 = 49152

    I've just tried 17.0.0 and it has the same issue.

Children
  • I agree this must be a different issue. The question is why the bootloader attempts to erase the flash page at 0x72000 as the log says. It should have been a page in bank 0 or bank 1. I would suggest that you step through the nrf_dfu_cache_prepare() to try find out why it's returning the wrong address.

  • It is getting the bank1 offset, which is bank 0 start address + bank 0 size. But how is that defined? Here is the output when generating the bootloader DFU settings:

    Bootloader DFU Settings:
    * File:                     ...DevKit_bootloader_setting.hex
    * Family:                   nRF52
    * Start Address:            0x0007F000
    * CRC:                      0x21811082
    * Settings Version:         0x00000002 (2)
    * App Version:              0x0000271B (10011)
    * Bootloader Version:       0x00000001 (1)
    * Bank Layout:              0x00000000
    * Current Bank:             0x00000000
    * Application Size:         0x0004C000 (311296 bytes)
    * Application CRC:          0x4D0DA3C7
    * Bank0 Bank Code:          0x00000001
    * Softdevice Size:          0x000248C0 (149696 bytes)
    * Boot Validation CRC:      0xACDA1BA2
    * SD Boot Validation Type:  0x00000000 (0)
    * App Boot Validation Type: 0x00000000 (0)

    I noticed that nrfutil settings generate says that the settings get backed up to (settings address - 0x1000) which in my case is 0x7E000, which is the MBR params, is this correct?

    After a bit more debugging I can see cache address = 0x72000, bootloader_start_addr = 0x72000 (correct), DFU_REGION_END(bootloader_start_addr) = 0x6E000 (correct: 0x72000 - 3 FDS pages (0x3000) - 0x1000 for the reserved flash).

    However, for some reason the assert isn't triggering:

    ASSERT(cache_address <= DFU_REGION_END(bootloader_start_addr));

    And then this ends up being false (incorrect):

    cache_too_small = required_size > (DFU_REGION_END(bootloader_start_addr) - cache_address);

    I think under the assert should be something like this in case assert is disabled:

    if(cache_address > DFU_REGION_END(bootloader_start_addr)) {
        cache_too_small = true;
        break;
    }

    However that doesn't explain why cache_address is incorrect. For some reason the bootloader settings indicates the application size is 0x4C000 which is the size of all the available application space (but the firmware itself is only 271609 = 0x424F8). How is the bank0/application size calculated when generating the dfu settings?

    ...it seems it converts to .bin and uses the size of the file. So why is the .hex converted to .bin 0x4C000? I confirmed it is that size using hex2bin.

    ...ah because of my provisioning block, need to remove the symbol. After modifying the arm-none-eabi-objcopy command to remove the symbol, it's working now!

Related