[U-Boot] [PULL] u-boot-usb/master

Pantelis Antoniou panto at antoniou-consulting.com
Tue Dec 18 13:01:18 CET 2012


Hi Lukasz,

Mystery solved then :)

On Dec 18, 2012, at 1:25 PM, Lukasz Majewski wrote:

> Hi Pantelis,
> 
>> Can you paste the log of your dfu-util session? Are you supplying a
>> transfer size for example?
>> 
>> Regards
> 
> u-boot-denx/master (denx.de) repository
> 
> SHA1: fd4d564b3c80b111f18c93adb14233a6a7ddb0e9
> 
> (without Pantelis patches)
> 
> dfu-util version 0.7 (not working):
> 
> lukma at amdc308:~/work/u-boot-denx(master)$ ../dfu-util/src/dfu-util -V
> -v -t 0x1000 -a0 -D u-boot.bin dfu-util 0.7
> 
> Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
> Copyright 2010-2012 Tormod Volden and Stefan Schmidt
> This program is Free Software and has ABSOLUTELY NO WARRANTY
> Please report bugs to dfu-util at lists.gnumonks.org
> 
> Opening DFU capable USB device... ID 04e8:6601
> Did not find cached descriptor
> WARNING: Can not find cached DFU functional descriptor
> Warning: Assuming DFU version 1.0
> Run-time device DFU version 0100
> Found DFU: [04e8:6601] devnum=0, cfg=2, intf=0, alt=0, name="u-boot"
> Claiming USB DFU Interface...
> Setting Alternate Setting #0 ...
> Determining device status: state = dfuIDLE, status = 0
> dfuIDLE, continuing
> Did not find cached descriptor
> Error obtaining cached DFU functional descriptor
> Error obtaining DFU functional descriptor
> Please report this as a bug!
> Warning: Assuming DFU version 1.0
> Warning: Transfer size can not be detected
> DFU mode device DFU version 0100
> Error: Transfer size must be specified
> 
> Broken.
> 

Newer version appears to expect the transfer size to be supplied by
the device in order to work.

> dfu-util version.  0.1+svnexported (available at debian repository
> (0.0+r4067-3.1))
> 
> lukma at amdc308:~/work/u-boot-denx(master)$ dfu-util -v -t 0x1000 -a0 -D
> u-boot.bin dfu-util - (C) 2007 by OpenMoko Inc.
> This program is Free Software and has ABSOLUTELY NO WARRANTY
> 
> Opening USB Device 0x0000:0x0000...
> Found Runtime: [0x04e8:0x6601] devnum=77, cfg=0, intf=0, alt=0,
> name="u-boot" Claiming USB DFU Interface...
> Setting Alternate Setting ...
> Determining device status: state = dfuIDLE, status = 0
> dfuIDLE, continuing
> Error obtaining DFU functional descriptor: error sending control
> message: Broken pipe Transfer Size = 0x1000
> bytes_per_hash=5591
> Starting download: [##################################################]
> finished! state(2) = dfuIDLE, status(0) = No error condition is present
> Done!
> 
> WORKS.
> 

I bet it only works because you supply the transfer size. Try omitting it
and see what happens.

> Ok, so world has went forward..... And I've left behind :-/. 
> 
> 
> With Pantelis Patches: 
> 
> lukma at amdc308:~/work/u-boot-denx(NEW_DFU)$ ../dfu-util/src/dfu-util -V
> -v -t 0x1000 -a0 -D u-boot.bin dfu-util 0.7
> 
> Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
> Copyright 2010-2012 Tormod Volden and Stefan Schmidt
> This program is Free Software and has ABSOLUTELY NO WARRANTY
> Please report bugs to dfu-util at lists.gnumonks.org
> 
> Opening DFU capable USB device... ID 04e8:6601
> Did not find cached descriptor
> WARNING: Can not find cached DFU functional descriptor
> Warning: Assuming DFU version 1.0
> Run-time device DFU version 0100
> Claiming USB DFU Runtime Interface...
> Determining device status: state = appIDLE, status = 0
> Device really in Runtime Mode, send DFU detach request...
> Resetting USB...
> Opening DFU USB Device...
> Found DFU: [04e8:6601] devnum=0, cfg=2, intf=0, alt=0, name="u-boot"
> Claiming USB DFU Interface...
> Setting Alternate Setting #0 ...
> Determining device status: state = dfuIDLE, status = 0
> dfuIDLE, continuing
> Did not find cached descriptor
> Error obtaining cached DFU functional descriptor
> DFU mode device DFU version 0110
^ correct DFU version detected
> Device returned transfer size 4096
^ and optimal transfer size

> No valid DFU suffix signature
> Warning: File has no DFU suffix
> bytes_per_hash=6280
> Copying data from PC to DFU device
> Starting download: [##################################################]
> finished! Sent a total of 314004 bytes
> state(2) = dfuIDLE, status(0) = No error condition is present
> Done!
> 
> 
> Ok, so it seems to work (CRC is correct, system boots). The reason
> of the turmoil from my side was the VERY OLD version of dfu-utils,
> which I've used for testing. 
> 
> I will thoroughly test this and let you know about the result. 
> The only thing, which I see as a problem (in this patch series) is:
> 
> +
> +#ifdef CONFIG_DFU_FUNCTION
> +		/* DFU is mighty weird */
> +		case DFU_DT_FUNC:
> 
> at ./gadget/composite.c
> 

It is weird. Wireshark for example decodes this as an HID class transfer, which
is certainly not. I don't know the exact details of the DFU protocol, but it is
possible that they didn't bother obtaining a real ID from the usb forum.

> Since I now know how to reproduce/test the problem I will try to
> remove this #ifdef.
> 
> After all this I have a huge "moral hangover".....
> 

No harm done. There is no such thing as a polite _and_ good engineer.
You always have to choose, and IMHO it's better to be a good one,
never mind the ruffled feathers :)

Cheers!

-- Pantelis

> -- 
> Best regards,
> 
> Lukasz Majewski
> 
> Samsung Poland R&D Center | Linux Platform Group



More information about the U-Boot mailing list