r5934 - trunk/src/host/dfu-util/src

stefan at docs.openmoko.org stefan at docs.openmoko.org
Sat Apr 24 23:59:40 CEST 2010


Author: stefan
Date: 2010-04-24 23:59:40 +0200 (Sat, 24 Apr 2010)
New Revision: 5934

Modified:
   trunk/src/host/dfu-util/src/main.c
Log:
main: Make sure we switch to the DFU interface

"usb_set_altinerface(_rt_dif.dev_handle, 0)" call seems to be necessary
to actually switch to the DFU interface when the USB-Device still uses
its default interface.
usb_claim_interface() doesn't send anything over the bus, but the
device needs to know when to serve DFU-Requests (like the following
dfu_get_status() request).
it works without it on devices where the DFU-Interface == 0 or the only
DFU interface available.
It doesn't work if a device offers a DFU-Device Descriptor in normal
runtime mode (to serve appDETACH requests).

For OM devices we did not hit the problem, but we have no problems with it
either.

Reported-by: Daniel Hiepler <nftlte at googlemail.com>

Modified: trunk/src/host/dfu-util/src/main.c
===================================================================
--- trunk/src/host/dfu-util/src/main.c	2010-04-24 21:59:37 UTC (rev 5933)
+++ trunk/src/host/dfu-util/src/main.c	2010-04-24 21:59:40 UTC (rev 5934)
@@ -588,6 +588,12 @@
 			exit(1);
 		}
 
+		if (usb_set_altinterface(_rt_dif.dev_handle, 0) < 0) {
+			fprintf(stderr, "Cannot set alt interface: %s\n",
+				usb_strerror());
+			exit(1);
+		}
+
 		printf("Determining device status: ");
 		if (dfu_get_status(_rt_dif.dev_handle, _rt_dif.interface, &status ) < 0) {
 			fprintf(stderr, "error get_status: %s\n",




More information about the commitlog mailing list