usb_reset, libusb20_compat01 and USB2

Bruce Cran bruce at cran.org.uk
Sat Feb 7 06:02:42 PST 2009


I've been working to port dfu-util, OpenMoko's USB DFU application, to
FreeBSD to work under USB2.  One problem I've found is that the device
starts out in Runtime Mode so dfu-util calls usb_reset to put it into
DFU mode; it seems to expect usb_reset to cause the system to detach
and reattach the device, but this doesn't happen.  As a result
usb_find_devices always returns 0 which triggers a warning; also,
since usb_reset causes the device to disappear on Linux dfu-util
doesn't call usb_close after resetting since the handle has become
invalid. A side-effect of this is that on FreeBSD a duplicate device
appears when doing a second enumeration pass.  Since dfu-util only
expects to see a single DFU-capable device it bails out, and it becomes
necessary to run it again for it to download the firmware (since the
phone is now already in DFU mode).

Is this a problem with the expectations of dfu-util, or should calling
usb_reset invalidate the device handle and cause the device to
re-attach?

-- 
Bruce Cran


More information about the freebsd-usb mailing list