Hi,

we are using dfu-util with some success for firmware upgrade of our USB 
controllers. Thanks for the great software.

However, there are some small things we want to add to work with our devices 
and to conform with the DFU 1.0 spec, in particular:

DFU_GETSTATUS ignores bwPollTimeout but does hardcoded usleep(5000) when doing 
DFU download:
This is a show-stoper for us, since this delay is too short and results in 
libusb 'Broken pipe' errors.
A patch implementing proper timeout handling is attached.

We plan some more changes such as ManifestationTolerant / WillDetach flag, and 
DFU image suffix handling (this should make the bluez project's 'dfutool' 
obsolete for us).


My question is, do you see a chance in getting these things upstream?
Since some distros are shipping slightly different SVN revisions, do you plan a 
real dfu-util release any time soon?


Best regards,
Sandro
--- ../dfu-util-openmoko/src/sam7dfu.c	2010-04-03 18:35:40.000000000 +0200
+++ src/sam7dfu.c	2010-04-03 20:04:11.000000000 +0200
@@ -2,6 +2,8 @@
  * USB DFU 1.0 Spec.  Not overloaded like the Atmel one...
  *
  * (C) 2007-2008 by Harald Welte <[email protected]>
+ * (C) 2010      by Sandro Giessl <[email protected]>
+ *                  Daniel Hiepler <[email protected]>
  */
 
 #include <stdio.h>
@@ -143,7 +145,10 @@ int sam7dfu_do_dnload(struct usb_dev_han
 				fprintf(stderr, "Error during download get_status\n");
 				goto out_close;
 			}
-			usleep(5000);
+                        /* respect bwPollTimeout (in msec) the device
+                           expects the host to wait before subsequent
+                           DFU_GETSTATUS (DFU 1.0, section 6.1.2) */
+			usleep(dst.bwPollTimeout*1000);
 		} while (dst.bState != DFU_STATE_dfuDNLOAD_IDLE);
 		if (dst.bStatus != DFU_STATUS_OK) {
 			printf(" failed!\n");
_______________________________________________
devel mailing list
[email protected]
https://lists.openmoko.org/mailman/listinfo/devel

Reply via email to