-
Notifications
You must be signed in to change notification settings - Fork 7.5k
USB DFU fixes #11027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB DFU fixes #11027
Conversation
no need for "subsys: " prefix in commits :) |
Codecov Report
@@ Coverage Diff @@
## master #11027 +/- ##
=======================================
Coverage 48.63% 48.63%
=======================================
Files 313 313
Lines 46435 46435
Branches 10710 10710
=======================================
Hits 22585 22585
Misses 19394 19394
Partials 4456 4456 Continue to review full report at Codecov.
|
Ok, I just pushed a new version without it. |
recheck |
@finikorg @jfischer-phytec-iot please review |
@aurel32 @jfischer-phytec-iot what remains to be done here? |
Would love to have this working in 1.14 |
what do you need help to understand? Ping me on slack if that's easier. |
@aurel32 do you have plans to fix this for 1.14? |
I think there is nothing to fix, it just needs a rebase. I have done one locally, but I still need to test it. |
@jfischer-phytec-iot I have just rebased the PR. |
With an SPI based flash, CONFIG_FLASH_BASE_ADDRESS is not defined. In that case it is safe to assume that the base address is 0. Signed-off-by: Aurelien Jarno <[email protected]>
The flash_read() function takes an offset from beginning of the flash. This patch subtract FLASH_BASE_ADDRESS from the absolute address. This fixes DFU firmware upload. Signed-off-by: Aurelien Jarno <[email protected]>
The upload code assumes the buffer to use is the DFU provide one, and not the one provided by the request handler, which is different in composite mode. This is only a theoretical issue, as this function is only executed once the device has been re-enumerated in legacy mode, but that is a required step before unifying legacy and composite code. Signed-off-by: Aurelien Jarno <[email protected]>
In composite mode the request handler buffer is common to all functions, and its size is defined by CONFIG_USB_COMPOSITE_BUFFER_SIZE. Given the device is enumerated as composite in runtime mode and as legacy in download mode, we need to define wTransferSize as the minimum of the two. Signed-off-by: Aurelien Jarno <[email protected]>
Given the device can be enumerated as both legacy and composite, we always need to provide the payload_data buffer. Signed-off-by: Aurelien Jarno <[email protected]>
This patchset fixes the DFU firmware upload function and the support for DFU in composite mode. It also fixes the upload code in view of unifying the USB legacy and composite code (issue #10503).
Fixes #12813