[U-Boot] dfu: bConfigurationValue=2 makes download from windows fail

Lukasz Majewski l.majewski at samsung.com
Thu Jul 25 16:02:42 CEST 2013


On Thu, 25 Jul 2013 12:29:01 +0000 Egli, Samuel samuel.egli at siemens.com
wrote,

Hi Samuel,

Thanks for very detailed bug/problem report.

> Hi Lukasz
> 
> We found out that there is an issue with dfu implementation on the
> latest U-Boot (v2013.07) when downloading from windows. From linux
> everything works fine. I discussed this with Tormod on the dfu-util
> mailing list.
> 
> In short, I found out that when downloading with dfu-util in libusbx
> in windows_usb.c at some point we have the comparison 
> "config_index >= dev->num_configurations" and which becomes
> "1 >= 1"
> and finally leads to return LIBUSB_ERROR_INVALID_PARAM.
> 
> This is because in U-Boot drivers/usb/gadget/g_dnl.c we have
> 
> LN 119: .bConfigurationValue =	CONFIG_USBDOWNLOADER, 
> 
> and CONFIG_USBDOWNLOADER = 2 
> 
> So my question is why do we have CONFIG_USBDOWNLOADER = 2? 


From the very short glimpse, I can suspect that this was set to 2
because of two supported functions (dfu and USB mass storage) at the
g_dnl gadget.

However this needs more investigation. I will delve into the code and
reply tomorrow with more details.

> In a
> previous dfu implementation in U-Boot (v2011.09)  bConfigurationValue
> was set to 1.

I've checked out to v2011.09 u-boot and as fair as I see DFU was not
implemented (in the mainline) then.

The first posted by me dfu implementation was at
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/129318/match=dfu+usb

Am I missing something? Do you use some older patch, which is unknown
to me?

> When setting CONFIG_USBDOWNLOADER to 1, dfu download
> works on windows again.
> 
> Is there any reasons against setting CONFIG_USBDOWNLOADER = 1?
> 
> Of course this could be solved on linbusbx side. But I have the 
> impression that this should be fixed in U-Boot. I posted my
> observations on the libusbx mailing list as well.
> 
> Here the logs that I posted there:
> 
> Log for dfu-util -a 1 -D MLO -v -v -v
> 
> Linux: http://pastebin.com/iq80kg0p -> ok
> Win:   http://pastebin.com/Ax7RDFHk -> fails
> 
> 
> Log for lsusb on linux for the different u-boot versions
> 
> U-Boot v2011-09: http://pastebin.com/jeC01WxQ
> U-Boot v2013-07: http://pastebin.com/mvNLkUAs
> 
> Best
>  Sam
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group


More information about the U-Boot mailing list