DFU OTA suddenly fails on "non secure" bootloaders but works on "secure" bootloaders.

Suddenly DFU OTA fails most of the time while trying to update units with code & "not secure" bootloader that has been working for years. The FW upload stops at 2% to 8% but if i restart my phone sometimes it reaches 15% and on happy days I can update the unit after rebooting the phone.

With the same DFU app DFU update works well with another unit with "secure" bootloader.

I am NOT trying to update a unit with "not secure" bootloader with code made for units with "secure bootloader" and vice versa.

What can suddenly be the problem?

Phone: Samsung Galaxy S21 Ultra 5G

Android version: 14

DFU app version: 2.9.0 (build 24123065)

Parents
  • Exact the same result with a Galaxy Tab A, model SM-T550 with Android 6.0.1, DFU app version: 2.9.0 (build 24123065)

  • Hi again.

    The problem has also been encounteed by our customers who can no longer update our products.

    - The "legacy" DFU bootloader has been the same and working in our product for several years, the DFu bootloader can't be the   problem.

    - The same "Update file" that has been working for years can't no longer be sent to the "product". The "Update file" can't be the problem.

    Devices with secure DFU bootloaders can be updated without problem.

    Devices with legacy DFU bootloaders can't be updated.

    I have found on Internet 2 possible reasons to this problem and they are:

    1. MTU Size Mismatch: DFU libraries, such as the Nordic DFU Library, often default to setting the Maximum Transmission Unit (MTU) size to 247 bytes. However, legacy bootloaders typically support a smaller MTU size of 23 bytes. This discrepancy can lead to upload failures, where the DFU process stalls or does not complete successfully. A user reported that reducing the MTU size to 23 bytes resolved the issue in their case. GitHub
    1. Secure DFU Service Blocking: Some platforms, like Google's Web Bluetooth API, have blacklisted the UUID associated with Nordic's legacy DFU service due to its lack of security features. This blacklist prevents web applications from utilizing this DFU method, leading developers to seek alternative solutions, such as implementing the Secure DFU Service or using different bootloader configurations. RAKwireless Forum

    Can you please help me find a solution to our problem?

     

  • There is a lot of factors that affect the upload speed, including the phone hardware and device capabilities. Modern phones are able to send a lot of packets in a single connection interval, exceeding the flash speed. Older phones didn't have this problem. In theory, it is the device that should control the flow, as it able to ignore writes that it cannot handle and simply not reply to them (on link layer).

    Instead, we try to calibrate it from the app side not knowing any of that.

    Also, we do have some logic here: https://github.com/NordicSemiconductor/Android-DFU-Library/blob/b0d73c655ea336b3cce0265614aac4d7d082e66f/lib/dfu/src/main/java/no/nordicsemi/android/dfu/LegacyDfuImpl.java#L503 that is trying to set PRN to 6, but only to decrease the value if it was set to >10. Also, room for improvement.

  • Great to hear that it works now. Thanks for the update. Regarding the packet receipt notification, this was suggested earlier. Also,   is a developer and maintainer of the DFU library.

    Anyway, please install the nRF DFU app and and in the app settings, set the PRN (packet receipt notification) to 1.
  • Yes, you suggested to turn it on, but you did not suggest to reduce the value from default 12 to for example 6.

  • Yeah.. it used to work with 12, back in the days, hence this is the default value.

    I'll change to 6 in the next release. 

    Funny, that phones and BLE is getting faster, but for Legacy DFU we set artificial limitations to slow it down.

  • Thanks yet again! And if you are going to change the app, please if possible make it visible that the default value can be changed. It just says 12 and there is no border or so that indicates that it's an input field.

Reply
  • Thanks yet again! And if you are going to change the app, please if possible make it visible that the default value can be changed. It just says 12 and there is no border or so that indicates that it's an input field.

Children
No Data