[U-Boot] [PATCH] dfu: fix some issues with reads/uploads

Lukasz Majewski
2014-06-03T07:51:21Z

Hi Stephen,

> On 06/02/2014 12:14 AM, Lukasz Majewski wrote:
> > Hi Stephen,
> >
> >> On 05/30/2014 02:28 AM, Lukasz Majewski wrote:
> >> ...
> >>> I've tested if raw u-boot can be downloaded and uploaded via DFU.
> >>> The u-boot size is 1MiB precisely.
> >>>
> >>> Corresponding dfu_alt_info entry:
> >>> "u-boot raw 0x80 0x800;" \
> >> ...
> >>> 2. Upload (raw):
> >>>
> >>> dfu-util -a0 -U u-boot-mmc.bin_target
> >>> It exits immediately and I can only see the file size of 0.
> >>>
> >>> So obviously we have regression here. However, since I didn't
> >>> covered this case in my tests I don't know when it was broken.
> >>
> >> Hmmm. I tested with that exact value of dfu_alt_info and got back
> >> an exactly 1MB file with either the dfu-util packaged in Ubuntu
> >> 12.10, or with the latest git tree of dfu-util.
> >
> > Could you share the exact SHA1 of the dfu-util? Or is it the master
> > newest branch?
>
> Distro package:
> dfu-util package 0.5-1 in Ubuntu 12.04.
>
> In the git tree:
> 25c173e3fd0a dfu_prefix: Rewrite handling of prefix requirements
> (which was origin/master when I fetched it a week or two ago)

I've updated the dfu-util to be the newest master.

commit fc81c6cc4eba30eaadf0010deb3d38f3be93ecd1
Author: Michael Grzeschik <mgr@pengutronix.de>
Date: Tue May 13 23:55:21 2014 +0200

I still read only zero length file:

lukma at AMDC2363:~/work/u-boot-denx(master)$ dfu-util -a0 -U
u-boot-mmc.bin_read 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
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 4096
Copying data from DFU device to PC
Upload [ ] 0% 0 bytes
Failed.

Regarding settings, I assume that they should not be changed, since
downloading the same data works.

I will look into that.

--
Best regards,

Lukasz Majewski

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