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

No transport to DfuTarg observed after "Enabling DFU Bootloader..."

First attempt at implementing buttonless dfu; assistance would be greatly appreciated. Using SDK v11 + s130 + nRF51822.

Please note that iphone screen captures supporting my observations can be seen here: https://goo.gl/VlYdBY

I wrote a bootloader, and successfully installed it with sd + app. It seems to be operating well and I'm able to debug, so I am capable of execution flow trace.

I created an app-only zip with good start packet using nrfutil, and added it to NRF Toolbox iOS app as a user file.

I start up my device, which is advertising for dfu properly.

In NRF Toolbox I select my file, then select my device as the target. I then tap "Upload".

The ios App begins the process. It quickly says "Starting update" followed by "Enabling DFU Bootloader...", and then it just sits there forever.

In debugging on the device, I can see that I get all the way through dfu_transport_update_start just fine, and at this point I'm in the bootloader.c wait_for_events() loop as I should be. (It eventually times out properly.)

However, oddly, while the phone is sitting there "Enabling DFU Bootloader...", the device never reaches ble_evt_dispatch() in the dfu transport - not a single time - indicating to me that the phone doesn't seem to be connecting into my device to initiate the transport.

When I use nRF Connect to see what's going on, I do see DfuTarg being advertised. When I Connect to it, I see "Legacy DFU Service" as the primary service. When I open the service, I see Legacy DFU Packet, Control Point, and Revision. (See photos for details.)

The encouraging thing is that when I do use nRF Connect to examine these things, I DO nicely get events coming into the handler at ble_evt_dispatch() within dfu_transport_ble.c. However, as I said, I get nothing coming into that handler as triggered by nRF Toolbox's DFU process.

(It is a bit odd that these things are called "Legacy DFU" given that I'm using the up-to-date SDK and the up-to-date nRF Toolbox & Connect apps. Perhaps a better version must be coming in sdkv12?)

In any case, as I said, the DFU seems to be starting nicely, but I'm blocked at this point given that the BLE transport doesn't seem to be being kicked off.

Any thoughts about what to try next would sincerely be appreciated; thanks for your time.

Parents
  • More info from xcode. If someone can spot something it would be appreciated. Basically, it is jumping just fine into the bootloader, and then the iOS app fails to reconnect to the peripheral. Of course, by the time it reconnects to the peripheral, there is a different service name (DfuTarg) and primary service UUID. Still trying to poke through the iOS code to see how it locates the peripheral under the now-different (1530) primary service UUID.

    Aug  1 17:51:08 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Connecting to Teletype...
    Aug  1 17:51:08 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: centralManager.connectPeripheral(peripheral, options:nil)
    Aug  1 17:51:09 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: [Callback] Central Manager did connect peripheral
    Aug  1 17:51:09 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Connected to Teletype
    Aug  1 17:51:09 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Discovering services...
    Aug  1 17:51:09 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: periphera.discoverServices(nil)
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Services discovered
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: DFU Service found
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Discovering characteristics in DFU Service...
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: peripheral.discoverCharacteristics(nil, forService:DFUService)
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: DFU characteristics discovered
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Reading DFU Version number...
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: peripheral.readValueForCharacteristic(00001534-1212-EFDE-1523-785FEABCD123)
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Read Response received from 00001534-1212-EFDE-1523-785FEABCD123, value (0x):0100
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 10: Version number read: 0.1
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Enabling notifiactions for 00001531-1212-EFDE-1523-785FEABCD123...
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: peripheral.setNotifyValue(true, forCharacteristic: 00001531-1212-EFDE-1523-785FEABCD123)
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Notifications enabled for 00001534-1212-EFDE-1523-785FEABCD123
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 10: DFU Control Point notifications enabled
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 15: Application with buttonless update found
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: peripheral.writeValue(0x0104, forCharacteristic: 00001531-1212-EFDE-1523-785FEABCD123, type: WithResponse)
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Data written to 00001531-1212-EFDE-1523-785FEABCD123
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 10: Jump to bootloader (Op Code = 1, Upload Mode = 4) request sent
    Aug  1 17:51:12 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: [Callback] Central Manager did disconnect peripheral
    Aug  1 17:51:12 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Disconnected by the remote device
    Aug  1 17:51:12 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Connecting to Teletype...
    Aug  1 17:51:12 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: centralManager.connectPeripheral(peripheral, options:nil)
    
Reply
  • More info from xcode. If someone can spot something it would be appreciated. Basically, it is jumping just fine into the bootloader, and then the iOS app fails to reconnect to the peripheral. Of course, by the time it reconnects to the peripheral, there is a different service name (DfuTarg) and primary service UUID. Still trying to poke through the iOS code to see how it locates the peripheral under the now-different (1530) primary service UUID.

    Aug  1 17:51:08 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Connecting to Teletype...
    Aug  1 17:51:08 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: centralManager.connectPeripheral(peripheral, options:nil)
    Aug  1 17:51:09 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: [Callback] Central Manager did connect peripheral
    Aug  1 17:51:09 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Connected to Teletype
    Aug  1 17:51:09 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Discovering services...
    Aug  1 17:51:09 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: periphera.discoverServices(nil)
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Services discovered
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: DFU Service found
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Discovering characteristics in DFU Service...
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: peripheral.discoverCharacteristics(nil, forService:DFUService)
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: DFU characteristics discovered
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Reading DFU Version number...
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: peripheral.readValueForCharacteristic(00001534-1212-EFDE-1523-785FEABCD123)
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Read Response received from 00001534-1212-EFDE-1523-785FEABCD123, value (0x):0100
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 10: Version number read: 0.1
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Enabling notifiactions for 00001531-1212-EFDE-1523-785FEABCD123...
    Aug  1 17:51:10 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: peripheral.setNotifyValue(true, forCharacteristic: 00001531-1212-EFDE-1523-785FEABCD123)
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Notifications enabled for 00001534-1212-EFDE-1523-785FEABCD123
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 10: DFU Control Point notifications enabled
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 15: Application with buttonless update found
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: peripheral.writeValue(0x0104, forCharacteristic: 00001531-1212-EFDE-1523-785FEABCD123, type: WithResponse)
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Data written to 00001531-1212-EFDE-1523-785FEABCD123
    Aug  1 17:51:11 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 10: Jump to bootloader (Op Code = 1, Upload Mode = 4) request sent
    Aug  1 17:51:12 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: [Callback] Central Manager did disconnect peripheral
    Aug  1 17:51:12 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 5: Disconnected by the remote device
    Aug  1 17:51:12 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 1: Connecting to Teletype...
    Aug  1 17:51:12 Rays-IPhone-6s nRF Toolbox[896] <Warning>: 0: centralManager.connectPeripheral(peripheral, options:nil)
    
Children
No Data
Related