Prioritizing DFU speed in settings #467
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR modifies the default DFU parameters:
The goal is to make the DFU faster (reach ~ 9kB/s) on most moden devices.
What are those settings?
In Secure DFU the firmware is sent in chunks (4096 bytes each). Each chunk is validated (Calculate CRC) and executed after sending. Executing it saves teh received data in permanent storage on the device. Some implementations of DFU bootloader notify readiness after executing too soon, before the data is actually saved. Prepare Data Object delay is a special delay added after receiving Execute response to give the device some time to finish flash operation. I don't think it's needed with nRF5 SDK 17.1.
Read more here:
Android-DFU-Library/lib/dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java
Lines 197 to 219 in e2c8028
Secure DFU from nRF5 SDK 15+ supports MTU (Maximum Transfer Unit) higher than default (23 bytes). With higher MTU more data can be sent in a unit of time. However, some devices, like Samsung Tab A8 and perhaps other with the same hardware claim support for it, but in fact they have a bug preventing use of it. The library will automatically disable MTU for devices with
Build.HARDWARE
set toums512_25c10
(see Disabling MTU request on Samsung Tab A8 #408), but perhaps there are other devices with similar problem. If you get error 133 just after sending the upload, try disabling MTU request in app's Settings.