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

iOS nRF Toolbox App DFU Mode failes to launch in bootloader, but no issues on Android with same firmware

We work with custom firmware and use the softdevice 2.0.1 on the nrf51822

I upload the firmware as .zip file using the android nrf Toolbox, which works fine, but when performing the same action using the iOS nrf toolbox app, it fails with the following xcode debug log:

2018-10-09 16:07:51.557526+0200 nRF Toolbox[327:15607] [CoreBluetooth] XPC connection invalid
Verbose: Connecting to AQ Minion...
Debug: centralManager.connect(peripheral, options: nil)
Debug: [Callback] Central Manager did connect peripheral
Info: Connected to AQ Minion
Verbose: Discovering services...
Debug: peripheral.discoverServices(nil)
Info: Services discovered
Verbose: Starting Secure DFU...
Info: Connected to AQ Minion
Info: Services discovered
Verbose: Secure DFU Service found
Verbose: Discovering characteristics in DFU Service...
Debug: peripheral.discoverCharacteristics(nil, for: FE59)
Info: DFU characteristics discovered
Verbose: Enabling notifications for 8E400001-F315-4F60-9FB8-838830DAEA50...
Debug: peripheral.setNotifyValue(true, for: 8E400001-F315-4F60-9FB8-838830DAEA50)
Verbose: Notifications enabled for 8E400001-F315-4F60-9FB8-838830DAEA50
Application: Buttonless DFU notifications enabled
Warning: Application with buttonless update found
Verbose: Writing to characteristic 8E400001-F315-4F60-9FB8-838830DAEA50...
Debug: peripheral.writeValue(0x01, for: 8E400001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Error: Writing to characteristic failed
Error: Error 130: Unknown ATT error.
Verbose: Disconnecting...
Debug: centralManager.cancelPeripheralConnection(peripheral)
Debug: [Callback] Central Manager did disconnect peripheral
Info: Disconnected

it looks like the buttonless dfu service launching the nrf chip from the bootloader fails to write the 0x01 enterBootloader characteristic (See ButtonlessDFUOpCode). Is there any whay to get that working, or does the DFU mode on iOS generally not work?

  • I found a way to make it work, even though it's a bit hacky. But maybe this solution helps someone to figure out how to fix it properly:

    If ignoring the error report from the didWriteValueFor characteristic call back in the ButtonlessDFU class, it works

        func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) {
            if error != nil {
                logger.e("Writing to characteristic failedededed")
                logger.e(error!)
    //            report?(.writingCharacteristicFailed, "")
            } else {
                logger.i("Data written to \(characteristic.uuid.uuidString)")
            }
        }

Related