Skip to content

Sometimes stucks at Sending firmware to DFU Packet characteristic... for a long time #515

@pontusarfwedson

Description

@pontusarfwedson

DFU Bootloader version (please complete the following information):

  • Bonding used: yes
  • Library version: 4.13.0

Device information (please complete the following information):

  • Device: iPhone 12
  • OS: 17.0.3

Describe the bug
We initiate a DFU to a our peripheral device using this code

let selectedFirmware = try DFUFirmware(urlToZipFile: savedURL)
            
let initiator = DFUServiceInitiator().with(firmware: selectedFirmware)
initiator.logger = self
initiator.delegate = currentDfuDelegate
initiator.progressDelegate = currentProgressDelegate

let controller = initiator.start(target: peripheral)

It generally works OK and can finish DFU:ing our firmware in ~30-45 seconds. However, sometimes it simply goes to Sending firmware to DFU Packet characteristic ... and then nothing happens. Sometimes our bootloader will decide to restart resulting in a full restart of the DFU. Sometimes it suddenly progresses. This can be after anywhere from 30 seconds to 5 minutes. This can happen at any point during the DFU and sometimes multiple times during a single DFU.
What is the reason for it getting stuck at that point? Simply put, what is it waiting for? And is there anything we can do to mitigate this?
We are using your equivalent library for Android and there this never happens.

Logs

DEBUG: OtaService: DFU progress: Sending firmware to DFU Packet characteristic...
DEBUG: OtaService: DFU progress: Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
DEBUG: OtaService: DFU progress: peripheral.writeValue(0x03, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
DEBUG: OtaService: DFU progress: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
DEBUG: OtaService: DFU progress: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 60030100b00100d5286317
DEBUG: OtaService: DFU progress: Checksum (Offset = 110592, CRC = 176328D5) received
DEBUG: OtaService: DFU progress: Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
DEBUG: OtaService: DFU progress: peripheral.writeValue(0x04, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
DEBUG: OtaService: DFU progress: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
DEBUG: OtaService: DFU progress: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600401
DEBUG: OtaService: DFU progress: Data object executed
DEBUG: OtaService: DFU progress: Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
DEBUG: OtaService: DFU progress: peripheral.writeValue(0x010200100000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
DEBUG: OtaService: DFU progress: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
DEBUG: OtaService: DFU progress: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
DEBUG: OtaService: DFU progress: Data object 28/29 created
DEBUG: OtaService: DFU progress: Uploading firmware...
DEBUG: OtaService: DFU progress: Sending firmware to DFU Packet characteristic...

--- TWO MINUTES OF SILENCE HERE ---

DEBUG: OtaService: DFU progress: Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
DEBUG: OtaService: DFU progress: peripheral.writeValue(0x03, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
DEBUG: OtaService: DFU progress: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
DEBUG: OtaService: DFU progress: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 60030100c00100981dcc7a
DEBUG: OtaService: DFU progress: Checksum (Offset = 114688, CRC = 7ACC1D98) received
DEBUG: OtaService: DFU progress: Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
DEBUG: OtaService: DFU progress: peripheral.writeValue(0x04, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
DEBUG: OtaService: DFU progress: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
DEBUG: OtaService: DFU progress: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600401
DEBUG: OtaService: DFU progress: Data object executed
DEBUG: OtaService: DFU progress: Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
DEBUG: OtaService: DFU progress: peripheral.writeValue(0x010260040000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
DEBUG: OtaService: DFU progress: Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
DEBUG: OtaService: DFU progress: Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
DEBUG: OtaService: DFU progress: Data object 29/29 created
DEBUG: OtaService: DFU progress: Uploading firmware...
DEBUG: OtaService: DFU progress: Sending firmware to DFU Packet characteristic...
DEBUG: OtaService: DFU progress: Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions