laforge submitted this change.

View Change

Approvals: Jenkins Builder: Verified lynxis lazus: Looks good to me, approved
dfu: do not reset itself

In theory USB_DFU_ATTRIBUTES_WILL_DETACH is nice, in practice
not so much, because usb uses control transfers and "waiting" for
status response completion after finishing flashing is cumbersome.
There is basically no advantage if the device resets itself, and
just waiting for the host to do it like most DFU devices
(and what the BL used to do in the beginning) works
around the status issue.

Right now dfu-utils is unhappy because the final get status never is answered because the response is submitted by the device, but the self reset immediately afterwards is faster, so it never arrives at the host.

Change-Id: I1b9e48470083597640918a8a1126922b31150153
---
M usb/class/dfu/device/dfudf_desc.h
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/usb/class/dfu/device/dfudf_desc.h b/usb/class/dfu/device/dfudf_desc.h
index 50a79e4..cb8e8b1 100644
--- a/usb/class/dfu/device/dfudf_desc.h
+++ b/usb/class/dfu/device/dfudf_desc.h
@@ -75,10 +75,11 @@
CONF_USB_DFUD_BMATTRI, \
CONF_USB_DFUD_BMAXPOWER)

-#define DFUD_IFACE_DESCB USB_DFU_FUNC_DESC_BYTES(USB_DFU_ATTRIBUTES_CAN_DOWNLOAD | USB_DFU_ATTRIBUTES_WILL_DETACH, \
- 0, /**< detaching makes only sense in run-time mode */ \
- 512, /**< transfer size corresponds to page size for optimal flash writing */ \
- 0x0110 /**< DFU specification version 1.1 used */ )
+#define DFUD_IFACE_DESCB \
+ USB_DFU_FUNC_DESC_BYTES(USB_DFU_ATTRIBUTES_CAN_DOWNLOAD, \
+ 0, /**< detaching makes only sense in run-time mode */ \
+ 512, /**< transfer size corresponds to page size for optimal flash writing */ \
+ 0x0110 /**< DFU specification version 1.1 used */)

#define DFUD_IFACE_DESCES \
USB_IFACE_DESC_BYTES(CONF_USB_DFUD_BIFCNUM, \

To view, visit change 42180. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-Change-Id: I1b9e48470083597640918a8a1126922b31150153
Gerrit-Change-Number: 42180
Gerrit-PatchSet: 3
Gerrit-Owner: Hoernchen <ewild@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu>