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

nrf51822 DFU procedure nrf toolbox not working ?

Hello,

I am using nrftoolbox code available here:github.com/.../IOS-nRF-Toolbox to perform the DFU procedure.

I have taken the firmware zip file.

I have integrated the iOSDFULibrary in my ios application using POD. Currently I have manually writing 0x0100 command on BLE application to put it into Bootloder mode. I feel that I am successfully able to put it in DFU mode but after that i am using below code :

DFUFirmware *selectedFirmware = [[DFUFirmware alloc] initWithUrlToZipFile:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"xyz" ofType:@"zip"]]];
            
            
            DFUServiceInitiator *initiator = [[DFUServiceInitiator alloc] initWithCentralManager:self.centralManager target:self.sensorTag];
            [initiator withFirmware:selectedFirmware];
            // Optional:
            // initiator.forceDfu = YES/NO; // default NO
            // initiator.packetReceiptNotificationParameter = N; // default is 12
            initiator.logger = self; // - to get log info
            initiator.delegate = self; // - to be informed about current state and errors
            initiator.progressDelegate = self; // - to show progress bar
            // initiator.peripheralSelector = ... // the default selector is used
            
            DFUServiceController *controller = [initiator start];

which fails with the below given log.

here is my DFU logs:

2017-04-05 11:24:48.270660 BLETemperatureReader[3595:805070] findCharacteristicFromUUID
2017-04-05 11:24:48.270976 BLETemperatureReader[3595:805070] dfu data:<0100>
2017-04-05 11:24:53.864257 BLETemperatureReader[3595:805070] didDisconnectPeripheral
2017-04-05 11:24:54.319596 BLETemperatureReader[3595:805070] didConnectPeripheral
2017-04-05 11:24:54.320346 BLETemperatureReader[3595:805070] Peripheral State = 2
2017-04-05 11:24:54.320419 BLETemperatureReader[3595:805070] DFU mode activated
2017-04-05 11:24:54.378580 BLETemperatureReader[3595:805070] level String: Info, message :Connected to Beam
2017-04-05 11:24:54.378728 BLETemperatureReader[3595:805070] level String: Verbose, message :Discovering services...
2017-04-05 11:24:54.378814 BLETemperatureReader[3595:805070] level String: Debug, message :peripheral.discoverServices(nil)
2017-04-05 11:24:54.380225 BLETemperatureReader[3595:805070] peripheral connecting for DFU
2017-04-05 11:24:54.468923 BLETemperatureReader[3595:805070] level String: Info, message :Services discovered
2017-04-05 11:24:54.471858 BLETemperatureReader[3595:805070] level String: Verbose, message :Starting Legacy DFU...
2017-04-05 11:24:54.472976 BLETemperatureReader[3595:805070] level String: Info, message :Connected to Beam
2017-04-05 11:24:54.473277 BLETemperatureReader[3595:805070] level String: Info, message :Services discovered
2017-04-05 11:24:54.473463 BLETemperatureReader[3595:805070] level String: Verbose, message :Legacy DFU Service found
2017-04-05 11:24:54.474766 BLETemperatureReader[3595:805070] level String: Verbose, message :Discovering characteristics in DFU Service...
2017-04-05 11:24:54.475164 BLETemperatureReader[3595:805070] level String: Debug, message :peripheral.discoverCharacteristics(nil, for: 00001530-1212-EFDE-1523-785FEABCD123)
2017-04-05 11:24:54.479716 BLETemperatureReader[3595:805070] level String: Info, message :DFU characteristics discovered
2017-04-05 11:24:54.481872 BLETemperatureReader[3595:805070] level String: Verbose, message :Reading DFU Version number...
2017-04-05 11:24:54.482126 BLETemperatureReader[3595:805070] level String: Debug, message :peripheral.readValue(00001534-1212-EFDE-1523-785FEABCD123)
2017-04-05 11:24:54.527232 BLETemperatureReader[3595:805070] level String: Error, message :Reading DFU Version characteristic failed
2017-04-05 11:24:54.528259 BLETemperatureReader[3595:805070] level String: Error, message :Error 1: The handle is invalid.
2017-04-05 11:24:54.528724 BLETemperatureReader[3595:805070] level String: Verbose, message :Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2017-04-05 11:24:54.530311 BLETemperatureReader[3595:805070] level String: Debug, message :peripheral.writeValue(0x06, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2017-04-05 11:24:54.586075 BLETemperatureReader[3595:805070] level String: Application, message :Reset (Op Code = 6) request sent
2017-04-05 11:24:54.586317 BLETemperatureReader[3595:805070] level String: Warning, message :Device disconnected before sending ACK
2017-04-05 11:24:54.586546 BLETemperatureReader[3595:805070] level String: Warning, message :Error 1: The handle is invalid.

I am not sure than I am doing the correct steps.Please guide me. We are using nrf51822 chipset with sdk 11.0.

By using NRFToolbox app DFU procedure. It is giving below log:

Verbose: Connecting to Beam...
Debug: centralManager.connect(peripheral, options:nil)
Debug: [Callback] Central Manager did connect peripheral
Info: Connected to Beam
Verbose: Discovering services...
Debug: peripheral.discoverServices([00001530-1212-EFDE-1523-785FEABCD123, FE59])
Info: Services discovered
Info: Connected to Beam
Verbose: Legacy DFU Service found
Verbose: Discovering characteristics in DFU Service...
Debug: peripheral.discoverCharacteristics(nil, for: 00001530-1212-EFDE-1523-785FEABCD123)
Info: DFU characteristics discovered
Verbose: Reading DFU Version number...
Debug: peripheral.readValue(00001534-1212-EFDE-1523-785FEABCD123)
Info: Read Response received from 00001534-1212-EFDE-1523-785FEABCD123, value (0x):0003
Application: Version number read: 3.0
Verbose: Enabling notifications for 00001531-1212-EFDE-1523-785FEABCD123...
Debug: peripheral.setNotifyValue(true, for: 00001531-1212-EFDE-1523-785FEABCD123)
Verbose: Notifications enabled for 00001531-1212-EFDE-1523-785FEABCD123
Application: DFU Control Point notifications enabled
Verbose: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
Debug: peripheral.writeValue(0x0100, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
Verbose: Writing image sizes (0b, 0b, 25296b) to characteristic 00001532-1212-EFDE-1523-785FEABCD123...
Debug: peripheral.writeValue(0x0000000000000000d0620000, for: 00001532-1212-EFDE-1523-785FEABCD123, type: .withoutResponse)
Info: Data written to 00001531-1212-EFDE-1523-785FEABCD123
Application: Start DFU (Op Code = 1, Upload Mode = 0) request sent
Verbose: Connecting to Beam...
Debug: centralManager.connect(peripheral, options:nil)
Debug: [Callback] Central Manager did disconnect peripheral
Info: Disconnected by the remote device

Thanks Aleksander, After following your suggestions. We now 2 steps ahead. but now we have below logs.

Could you please help me to let know what would be the problem?

Verbose: Connecting to Beam+...
Debug: centralManager.connect(peripheral, options: nil)
Debug: [Callback] Central Manager did connect peripheral
Info: Connected to Beam+
Verbose: Discovering services...
Debug: peripheral.discoverServices(nil)
Info: Services discovered
Verbose: Starting Legacy DFU...
Info: Connected to Beam+
Info: Services discovered
Verbose: Legacy DFU Service found
Verbose: Discovering characteristics in DFU Service...
Debug: peripheral.discoverCharacteristics(nil, for: 00001530-1212-EFDE-1523-785FEABCD123)
Info: DFU characteristics discovered
Verbose: Reading DFU Version number...
Debug: peripheral.readValue(00001534-1212-EFDE-1523-785FEABCD123)
Info: Read Response received from 00001534-1212-EFDE-1523-785FEABCD123, value (0x): 0100
Application: Version number read: 0.1
Verbose: Enabling notifications for 00001531-1212-EFDE-1523-785FEABCD123...
Debug: peripheral.setNotifyValue(true, for: 00001531-1212-EFDE-1523-785FEABCD123)
Verbose: Notifications enabled for 00001531-1212-EFDE-1523-785FEABCD123
Application: DFU Control Point notifications enabled
Warning: Application with buttonless update found
Verbose: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
Debug: peripheral.writeValue(0x0104, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
Info: Data written to 00001531-1212-EFDE-1523-785FEABCD123
Application: Jump to bootloader (Op Code = 1, Upload Mode = 4) request sent
Debug: [Callback] Central Manager did disconnect peripheral
Info: Disconnected by the remote device
Verbose: Connecting to Beam+...
Debug: centralManager.connect(peripheral, options: nil)
Debug: [Callback] Central Manager did connect peripheral
Info: Connected to Beam+
Verbose: Discovering services...
Debug: peripheral.discoverServices([00001530-1212-EFDE-1523-785FEABCD123])
Info: Services discovered
Verbose: Legacy DFU Service found
Verbose: Discovering characteristics in DFU Service...
Debug: peripheral.discoverCharacteristics(nil, for: 00001530-1212-EFDE-1523-785FEABCD123)
Info: DFU characteristics discovered
Verbose: Reading DFU Version number...
Debug: peripheral.readValue(00001534-1212-EFDE-1523-785FEABCD123)
Info: Read Response received from 00001534-1212-EFDE-1523-785FEABCD123, value (0x): 0100
Application: Version number read: 0.1
Verbose: Enabling notifications for 00001531-1212-EFDE-1523-785FEABCD123...
Debug: peripheral.setNotifyValue(true, for: 00001531-1212-EFDE-1523-785FEABCD123)
Verbose: Notifications enabled for 00001531-1212-EFDE-1523-785FEABCD123
Application: DFU Control Point notifications enabled
Warning: Application with buttonless update found
Verbose: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
Debug: peripheral.writeValue(0x0104, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
Info: Data written to 00001531-1212-EFDE-1523-785FEABCD123
Application: Jump to bootloader (Op Code = 1, Upload Mode = 4) request sent

Application just stop there and nothing happens.

Parents Reply Children
No Data
Related