# Why BLE OTA firmware updates fail and how to fix them
URL: https://alexmitrovic.com/blog/ble-ota-firmware-update-fails
Last updated: 2026-11-29

> Why BLE OTA and DFU updates fail from Android and iOS apps: drops mid-transfer, slow writes, background kills, bootloaders, and the fix for each.

[Throughput & OTA](https://alexmitrovic.com/blog#throughput-ota)

# Why BLE firmware updates fail (OTA and DFU), and how to make them finish

Why BLE OTA and DFU updates fail from Android and iOS apps: drops mid-transfer, slow writes, background kills, bootloaders, and the fix for each.

By [Alex Mitrovic](https://alexmitrovic.com/about)Published 29 November 20264 min read

## On this page

1. [What a reliable update looks like](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails#shape)
2. [The common failures, one by one](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails#failures)
3. [Resuming instead of restarting](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails#resume)
4. [The bootloader comes back different](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails#bootloader)
5. [Making it safe to interrupt](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails#safety)
6. [Libraries worth using](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails#libraries)
7. [FAQ](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails#faq)
8. [Sources](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails#sources)

**Stuck on this in a real app?** I fix it on real phones, usually within a week.

[Book a free call](https://alexmitrovic.com/contact)

Short answer

BLE firmware updates usually fail for a handful of reasons: the connection drops mid-transfer and the update can't resume, the app writes slowly and users give up, the OS suspends the app in the background, the device reboots into a bootloader the app can't find, or a stale GATT cache hides the new services. A reliable update resumes from the last confirmed offset, lets the device verify the image before switching, and handles the bootloader restart explicitly.

## Key takeaways

- Design for the connection dropping mid-update: resume from the last offset the device confirmed.
- The device, not the app, decides whether an image is valid: hash or signature checked before swap.
- Keep the device on its old image until the new one is verified, and confirmed after boot if you can.
- Expect the device to come back different in bootloader mode: another name, address or services.
- Run the transfer in a foreground service on Android, and keep the user informed on iOS.

A failed firmware update is the most expensive BLE bug: the user ends up with a device that doesn't work, or one that's stuck in its bootloader, and a call to support. The good news is that OTA failures are predictable. Each one below has a known design answer, and most of the work is deciding them with the firmware team before the first unit ships.

## What a reliable update looks like

1. **Pre-check:** battery level, firmware version compatibility, enough storage, decent RSSI.
2. **Prepare the link:** MTU, PHY and connection priority for speed (see [MTU and throughput](https://alexmitrovic.com/blog/ble-mtu-throughput)).
3. **Transfer in chunks** with offsets, so both sides always know how much arrived.
4. **Verify on the device:** hash or signature of the whole image, before anything switches.
5. **Swap and reboot** into the new image; the old one stays until the new one proves itself.
6. **Reconnect and confirm** the new version, then restore normal connection settings.

## The common failures, one by one

| Failure | What users see | Design answer
| Drop mid-transfer (status 8) | Update restarts at 0%, or fails | Resumable transfer: ask the device for its last offset and continue
| Slow transfer | Ten-minute progress bar, users quit | Write without response with flow control, MTU 247, DLE, 2M PHY
| App suspended or killed | Update stops when the phone locks | Android foreground service; on iOS keep the user in the flow and resume on return
| Bootloader not found | Device stuck after reboot, app waits forever | Know how the device advertises in DFU mode; scan for that
| Stale GATT cache | App can't find services after the update | Service Changed indication (bonded devices) or rediscovery
| Corrupt or wrong image | Device boots old firmware, or not at all | Device verifies hash/signature; version checks before starting
| Low battery | Device dies mid-update | Battery check before starting; device refuses below a threshold

## Resuming instead of restarting

The single biggest improvement for users: when the link drops at 70%, continue from 70%. That needs the device to remember how much it has received and tell the app when asked. Nordic's Secure DFU and MCUboot-based updates support resuming; with a custom protocol, put an offset in every chunk and a “where are you?” command in the protocol.

Resumable transfer, protocol-agnostic sketch

```
suspend fun sendImage(link: OtaLink, image: ByteArray, chunk: Int) {
    var offset = link.queryOffset()                 // device reports what it already has
    while (offset < image.size) {
        val end = minOf(offset + chunk, image.size)
        link.writeChunk(offset, image.copyOfRange(offset, end)) // write without response, flow-controlled
        offset = end
        if (offset % (chunk * 32) == 0 || offset == image.size) {
            offset = link.queryOffset()             // re-sync now and then: catches lost packets
            progress.value = offset.toFloat() / image.size
        }
    }
    link.requestVerify()                            // device checks hash/signature before swapping
}
```

Around it: reconnect on a drop with the policy from [connection drops](https://alexmitrovic.com/blog/ble-connection-drops-android), then call `sendImage` again; it picks up where it stopped.

## The bootloader comes back different

Many devices restart into a separate bootloader for the update, and it may not look like the device the app was talking to. Examples I've seen and that are documented: Nordic's nRF5 SDK Secure DFU bootloader, with buttonless DFU on an unbonded device, advertises at the device's address plus one; bootloaders often advertise under a different name; and the GATT services are different, so Android's cached service list is wrong. The app must know exactly what to scan for after the reboot, and the firmware team must write it down.

The same applies after the update: the device comes back with the new application's services. On a bonded device the firmware can send a Service Changed indication so the phone refreshes its cache; otherwise the app should rediscover services rather than trust the cache.

## Making it safe to interrupt

The firmware side decides whether a failed update is a nuisance or a support call. The pattern that works: two image slots, the new image written to the second slot, verified (hash, and a signature for production), then swapped. MCUboot adds a “test” swap that reverts on the next reboot unless the new image confirms itself, so an image that boots but doesn't work still falls back. The app's job is to give the device time to do this and confirm the version afterwards.

## Libraries worth using

- **Nordic Secure DFU:** Nordic's Android DFU Library and iOS DFU Library run the whole protocol, including the bootloader reconnection; on Android the library runs in its own service.
- **MCUboot / SMP:** Nordic's nRF Connect Device Manager libraries implement the SMP image upload used with MCUboot and Zephyr.
- **ESP32:** updates over Wi-Fi (HTTPS OTA) are often simpler than over BLE; over BLE it's usually a custom GATT protocol.

Add which of these you've shipped in production and one OTA problem you solved, with numbers if you can share them.

If you'd rather have it built: [OTA firmware updates](https://alexmitrovic.com/services/ota-firmware-updates).

## FAQ

### Why does my BLE firmware update restart from zero after a disconnect?

Because the update protocol, or the app's use of it, doesn't resume. The device must keep track of the bytes it received and report the offset, and the app must ask for it after reconnecting and continue from there.

### Why can't the app find my device after it enters DFU mode?

Bootloaders often advertise differently from the application: another name, other services, and on Nordic's nRF5 SDK with buttonless DFU on unbonded devices, the device address plus one. The app has to scan for the bootloader's advertisement, not the app's.

### Can a failed BLE update brick the device?

Not with a good bootloader design: the new image is written to a second slot, verified, and only then swapped, and with MCUboot's test swap it reverts if not confirmed. Single-slot designs that overwrite the running image are the ones that brick.

### How long should a BLE firmware update take?

It depends on image size and link settings. With write without response, MTU 247, DLE and 2M PHY, a few hundred kilobytes can take well under a minute in good conditions; with 20-byte writes and responses it can take many minutes. The throughput calculator gives an estimate.

## Sources

- [Nordic Semiconductor: Android DFU Library](https://github.com/NordicSemiconductor/Android-DFU-Library)
- [Nordic Semiconductor: iOS DFU Library](https://github.com/NordicSemiconductor/IOS-DFU-Library)
- [MCUboot documentation](https://docs.mcuboot.com/)
- [Espressif: ESP HTTPS OTA](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/system/esp_https_ota.html)
- [Bluetooth SIG: Core Specification (Service Changed)](https://www.bluetooth.com/specifications/specs/core-specification/)

**Written by Alex Mitrovic**, an Android and iOS developer who builds reliable apps for Bluetooth and IoT devices and tests every fix on real phones. If your app has this problem on phones you can't pin down, the [BLE reliability audit](https://alexmitrovic.com/services/ble-reliability-audit) finds out why in about a week. [About me](https://alexmitrovic.com/about) · [LinkedIn](https://www.linkedin.com/in/aleksmitro98/)

## Read next

[**Phone sends****Device writes****Resumes after a drop** Service### OTA firmware updatesFirmware updates from your Android and iOS app that finish every time: resumable, verified and fast, with Nordic DFU, MCUboot or your own protocol.](https://alexmitrovic.com/services/ota-firmware-updates)

[Article### BLE MTU and throughput: why your transfers are slow and what to changeHow MTU, Data Length Extension, 2M PHY, connection interval and write type decide BLE throughput on Android and iOS, and what to change first.](https://alexmitrovic.com/blog/ble-mtu-throughput)

[**Wall controller****App****Heated floor** Case study### Floor-heating controller appAn Android app for a water-based floor-heating controller: custom BLE protocol, OTA firmware updates, optimized file transfer, reconnection and a USB fallback.](https://alexmitrovic.com/work/floor-heating-controller)

## Seeing this in your own app?

Send me the phone models and what the logs say. On a short call I'll tell you where I'd look first.

[Book a free call](https://alexmitrovic.com/contact)

Free · NDA on request · reply within 1–2 working days
