cancel
Showing results for 
Search instead for 
Did you mean: 

BLE OTA FIRMWARE Update Fails at 65% on STM32WB5MMGH6TR with Android

MinhLuu
Associate

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

      0000FE23-8E22-4541-9D4C-21EDAE82ED19
      Android BLE stack fails mid-transfer on firmware, even with ACK-driven flow control

3. Steps Taken

  1. Connect to normal mode (A7) → send OTA trigger → disconnect

  2. Connect to OTA mode (A8)

  3. Discover services, request MTU 251, enable notifications

  4. Split firmware into chunks (max 200 bytes, WRITE_TYPE_DEFAULT)

  5. Send next chunk only after STM32 OTA notification ACK

  6. 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,

1 REPLY 1
STTwo-32
ST Employee

Hello @MinhLuu 

The OTA should work fine with the ST BLE Sensor, ST BLE ToolBox and the Web Bluetooth (always use the last versions to make sure it works fine).

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.