Menu

#67 AltSetting selection is not working properly

none
closed
nobody
None
2019-04-02
2019-03-27
No

Hello.
I have a device that has AlternateSettings 0 and 2, but not AlternateSetting 1:

# ./dfu-util -l
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2019 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [276c:df11] ver=0200, devnum=44, cfg=1, intf=0, path="(null)", alt=2, name="@EEPROM : TPL0102/0x00000000/01*013Be", serial="003700443038511630383637"
Found DFU: [276c:df11] ver=0200, devnum=44, cfg=1, intf=0, path="(null)", alt=0, name="@Internal Flash   /0x0800C000/01*016Kg,01*064Kg,01*128Kg", serial="003700443038511630383637"

I need to upload/download an image in AlternateSetting 2.
If I specify the parameter -a 2, dfu-util does not find a suitable device:

# ./dfu-util -U t.bin -s 0 -a 2
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2019 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util_trunk: No DFU capable USB device available

But, if I specify the parameter -a 1, dfu-util works correctly.

# ./dfu-util -U t.bin -s 0 -a 1
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2019 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 276c:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #2 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "EEPROM : TPL0102"
Limiting upload to end of memory segment, 13 bytes
Upload  [=========================] 100%           13 bytes
Upload done.

In my opinion, this is due to the fact that the value of the -a parameter is not compared with the one of the InternetSetting from the interface descriptor, but its sequence number.

I want to suggest you a small patch that fixes this problem.

1 Attachments

Discussion

  • Tormod Volden

    Tormod Volden - 2019-04-02
    • status: open --> closed
     
  • Tormod Volden

    Tormod Volden - 2019-04-02

    Thanks, you are right. I started looking at the same for interface number but I think that can be left as it is, any device must otherwise be very broken to have non-consecutive interface numbers. Patch committed.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB