BLE OTA FIRMWARE Update Fails at 65% on STM32WB5MMGH6TR with Android
I am experiencing an issue with OTA updates on the STM32WB5MMGH6TR when using an Android application. I would like your guidance and support in resolving it.
1. Device / Environment
Device: STM32WB5MMGH6TR
Android app: Custom OTA implementation using BluetoothGatt
ST BLE Sensor Android App versions tested:
ST BLE Sensor 4.18.1 → OTA fails
ST BLE Sensor Classic 4.20.1 → OTA fails
ST BLE Sensor 5.2.10 → OTA works successfully
2. Problem Description
OTA update fails consistently around 65% when updating to a different firmware version
Updating with the same firmware version works fine.
Android BLE log shows:
- system/stack/gatt/gatt_cl.cc:245 gatt_act_write: gatt_act_write() failed op_code=0x52 rt=143
- system/bta/gatt/bta_gattc_act.cc:1132 bta_gattc_write: write status:0
- system/btif/src/btif_gatt_client.cc:211 btif_gattc_upstreams_evt: Event BTA_GATTC_CONGEST_EVT [24]Using ST BLE Sensor 5.2.10, OTA completes successfully regardless of firmware version.
Observed behavior:
Chunks sent via WRITE_TYPE_DEFAULT with size ≤ MTU-3
Notifications enabled on for ACKs
Android BLE stack fails mid-transfer on firmware, even with ACK-driven flow control0000FE23-8E22-4541-9D4C-21EDAE82ED19
3. Steps Taken
Connect to normal mode (A7) → send OTA trigger → disconnect
Connect to OTA mode (A8)
Discover services, request MTU 251, enable notifications
Split firmware into chunks (max 200 bytes, WRITE_TYPE_DEFAULT)
Send next chunk only after STM32 OTA notification ACK
Retry mechanism implemented for failed writes
Observation: Despite proper ACK-driven chunk flow, OTA fails at ~65% when updating to a different firmware version, but works perfectly on THE SAME firmware.
Thansk,
