[PATCH dfu-util] main: Retrieve run-time and DFU mode functional descriptor

Tormod Volden lists.tormod at gmail.com
Sat Sep 24 13:30:56 CEST 2011

On Sat, Sep 24, 2011 at 12:50 PM, Stefan Schmidt wrote:
> I picked up your idea of keeping lsusb logs of the device in the git
> repo. A first patch that adds logs for all devices plus a short readme
> that describes what I know about the DFU device side implementations
> on this devices just hit the repo.

Great! Thanks a lot for that.

> Would be great to add logs for your devices once you find time for
> doing it. Actually anybody who uses dfu-util successfully with some
> devices that are not listed should take the moment and prepare a log
> for us. Just send them here.

It will also be very helpful to have the dfu-util -v -v ... output
from each device, so I can see which paths are being taken, and over
time reduce some cargo-cult. This should ideally be updated after each
release we make.

>> This should work without disturbing the Freerunner, and it should fall
>> back to reasonable defaults on devices such as the TAS1020B chip which do
>> not have any DFU functional descriptor at all.
> It works fine on the Freerunner and all other devices I have here.
> Great work! The mising functional descriptor is also the case for the
> Qi Hardware ATUSB device I have here. And the wrong handling of 1.1
> features and DFU version number seems to have spread into all OSS
> implemtations. Smeels like a crusade to get it fixed in all
> implementations out there. :)

Fantastic! Thanks for the extensive testing.

> I switched a bit back and forth between the patch and the whole code.
> It all looked good to me and the testing for all devices worked
> without problem. Just a small nitpick below.
>> +
>> +     ret = libusb_get_active_config_descriptor(dfu_if->dev, &cfg);
>> +     if (ret == LIBUSB_ERROR_NOT_FOUND) {
>> +             fprintf(stderr, "Error: Device is unconfigured\n");
>> +             return -1;
>> +     } else if (ret) {
>> +             fprintf(stderr, "Error: failed "
>> +                     "libusb_get_config_descriptor_by_value()\n");
> Here should go the correct function we fail on. :) I fixed that up for
> you after I merged the patch.

I also have some nitpicks with my patch. I did not get to send an
updated patch in time, but will send a follow-up patch. Which happens
to revert your fix-up :)


More information about the devel mailing list