dfu upgrade failed

Hi,

Customers have reported the problem of dfu upgrade failure, and we also use the same type of mobile phone (iPhone 11 & iPhone XR) for testing. It is found that there is indeed a problem of upgrade failure, but this failure is random and does not happen often. And, once there is an upgrade failure, it will keep appearing. At least for a while, the upgrade was unsuccessful. The current software uses sdk 17.1 and flash_s140_nrf52_7.3.0_softdevice.

Some logs on failure:

Parts: 1
Size: 303 KB
Soft Device Size: Zero KB
Bootloader Size: Zero KB
Connecting to Bt_test
Connected to Bt_test
Discovering services...
Services discovered
Starting Secure DFU...
Connected to Bt_test
Services discovered
Secure DFU Service found
Discovering characteristics in DFU Service...
DFU characteristics discovered
Enabling indications for 8EC90003-F315-4F60-9FB8-838830DAEA50...
Indications enabled for 8EC90003-F315-4F60-9FB8-838830DAEA50
Buttonless DFU indications enabled
Application with buttonless update found
Trying setting bootloader name to Dfu10658
Writing to characteristic 8EC90003-F315-4F60-9FB8-838830DAEA50...
Data written to 8EC90003-F315-4F60-9FB8-838830DAEA50
Indication received from 8EC90003-F315-4F60-9FB8-838830DAEA50, value (0x):200204
Error 4: Operation failed
Disconnecting...
Disconnected

Some logs when the upgrade is successful:

Parts: 1
Size: 303 KB
Soft Device Size: Zero KB
Bootloader Size: Zero KB
Connecting to Bt_test
Connected to Bt_test
Discovering services...
Services discovered
Starting Secure DFU...
Connected to Bt_test
Services discovered
Secure DFU Service found
Discovering characteristics in DFU Service...
DFU characteristics discovered
Enabling indications for 8EC90003-F315-4F60-9FB8-838830DAEA50...
Indications enabled for 8EC90003-F315-4F60-9FB8-838830DAEA50
Buttonless DFU indications enabled
Application with buttonless update found
Trying setting bootloader name to Dfu33136
Writing to characteristic 8EC90003-F315-4F60-9FB8-838830DAEA50...
Data written to 8EC90003-F315-4F60-9FB8-838830DAEA50
Indication received from 8EC90003-F315-4F60-9FB8-838830DAEA50, value (0x):200201
Response (Op Code = Set Name, Status = Success) received
Bootloader name changed successfully
Writing to characteristic 8EC90003-F315-4F60-9FB8-838830DAEA50...
Data written to 8EC90003-F315-4F60-9FB8-838830DAEA50
Indication received from 8EC90003-F315-4F60-9FB8-838830DAEA50, value (0x):200101
Response (Op Code = Enter Bootloader, Status = Success) received
Disconnected.
Disconnected by the remote device
Scanning for the DFU Bootloader...
DFU Bootloader found with name Dfu33136
Connecting to Dfu36593...
Connected to Dfu36593
Discovering services...
Services discovered
Secure DFU Service found
Discovering characteristics in DFU Service...
DFU characteristics discovered
MTU set to 247
Enabling notifications for 8EC90001-F315-4F60-9FB8-838830DAEA50...
Notifications enabled for 8EC90001-F315-4F60-9FB8-838830DAEA50

This seems to be a probabilistic problem, how can I fix it?

thanks.

Parents
  • I see, that should be fine. Since the Advertising Interval here recommends using the advertising interval of 20 ms for 30 seconds before moving to either of the longer advertising intervals. Many of our example projects have different advertising intervals. One FAST and one SLOW, and with different advertising durations for these. Reference below:

    #define APP_ADV_FAST_INTERVAL          40                                     /**< The advertising interval (in units of 0.625 ms). The default value corresponds to 25 ms. */
    #define APP_ADV_SLOW_INTERVAL          3200                                   /**< Slow advertising interval (in units of 0.625 ms). The default value corresponds to 2 seconds. */
    
    #define APP_ADV_FAST_DURATION          3000                                   /**< The advertising duration of fast advertising in units of 10 milliseconds. */
    #define APP_ADV_SLOW_DURATION          18000                                  /**< The advertising duration of slow advertising in units of 10 milliseconds. */

    NRF_BLE_GATT_MTU_EXCHANGE_INITIATION_ENABLED should not affect the DFU as far as I know.

    Best regards,

    Simon

Reply
  • I see, that should be fine. Since the Advertising Interval here recommends using the advertising interval of 20 ms for 30 seconds before moving to either of the longer advertising intervals. Many of our example projects have different advertising intervals. One FAST and one SLOW, and with different advertising durations for these. Reference below:

    #define APP_ADV_FAST_INTERVAL          40                                     /**< The advertising interval (in units of 0.625 ms). The default value corresponds to 25 ms. */
    #define APP_ADV_SLOW_INTERVAL          3200                                   /**< Slow advertising interval (in units of 0.625 ms). The default value corresponds to 2 seconds. */
    
    #define APP_ADV_FAST_DURATION          3000                                   /**< The advertising duration of fast advertising in units of 10 milliseconds. */
    #define APP_ADV_SLOW_DURATION          18000                                  /**< The advertising duration of slow advertising in units of 10 milliseconds. */

    NRF_BLE_GATT_MTU_EXCHANGE_INITIATION_ENABLED should not affect the DFU as far as I know.

    Best regards,

    Simon

Children
No Data
Related