DFU u-boot patch with beagleboard-xM support

256 views
Skip to first unread message

Bernard Blackham

unread,
Feb 28, 2011, 8:08:12 PM2/28/11
to beagl...@googlegroups.com
Hi all,

I've been working on loading images into RAM using DFU on the
BeagleBoard-xM. It seemed that there were several bitrotting patches
around. I've merged the best of each into something that works for
me for loading images into RAM on the -xM (but flash support is
broken and untested).

For posterity, attached is a patch against u-boot releases 2010.12
and 2011.03-rc1 (applies to either). It's still not in a clean
enough state for merging into u-boot, but I thought this list may
appreciate it.

I've had to revert to an older version of the musb_udc driver to get
it working, as the one in mainline u-boot seems to have a broken
state machine (which I was able to fix), and did not support High
Speed gadget mode (which I couldn't easily fix).

Thanks also go to Matthew Warton at OK Labs.

Cheers,
Bernard.

Bernard Blackham

unread,
Feb 28, 2011, 8:13:35 PM2/28/11
to beagl...@googlegroups.com
u-boot-2010.12-beagle-dfu.diff.gz

rick

unread,
Mar 6, 2011, 11:28:52 AM3/6/11
to Beagle Board
Hi Bernard,

I tried your patch and it tries to work but just hangs at the
download stage. On the host side I get:
---------------------------------------
dfu-util does currently only support DFU version 1.0

Opening DFU USB device... ID 0525:a4a7
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB...
Opening USB Device...
Found Runtime: [0x0525:0xa4a7] devnum=7, cfg=0, intf=0, alt=0,
name="RAM 0x81000000"
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Device returned transfer size 4096
bytes_per_hash=42610
Copying data from PC to DFU device
Starting download: [
-------------------------------------------

On the target I get:

--------------------------------------------
OMAP3 beagleboard.org
#
OMAP3 beagleboard.org # DFU: Switching to DFU
Mode
Got DNLOAD req in dfuIDLE, len =
4096
Starting DFU DOWNLOAD to RAM
(0x81000000)
--------------------------------------------

Is it because dfu_util only does DFU 1.0?

Thanks,

Rick

Bernard Blackham

unread,
Mar 7, 2011, 6:31:05 PM3/7/11
to beagl...@googlegroups.com
Hi Rick,

Rhe warning message about dfu-util should be nothing to worry about. FTR, I've used the dfu-util that comes with both Ubuntu Maverick (10.10) and Debian Lenny (5.0).

Can you try dropping the transfer size down by passing -t 0x40 to dfu-util? Try powers of two between 32 (0x20) and 4096 (0x1000). It might be that your USB host controller or driver has issues with larger frames on EP0.

Or it may be a broken build - I've uploaded the u-boot.bin I am using (on an SD card) to http://bernard.largestprime.net/tmp/beaglexm-dfu-u-boot.bin

HTH,
Bernard.

> --
> You received this message because you are subscribed to the Google Groups "Beagle Board" group.
> To post to this group, send email to beagl...@googlegroups.com.
> To unsubscribe from this group, send email to beagleboard...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.
>

Bernard Blackham

unread,
Mar 9, 2011, 10:41:13 PM3/9/11
to beagl...@googlegroups.com
On Sun, Mar 06, 2011 at 08:28:52AM -0800, rick wrote:
> I tried your patch and it tries to work but just hangs at the
> download stage.

Rick and I resolved this issue off-list. It turns out that the patch
did not correctly populate one of the fields used by newer versions
of dfu-util (specifically, bwPollTimeout). This version fixes it.

New version attached.

Tangentially related - an extra patch to dfu-util improves download
speed from ~450KB/s to ~2 MB/s:
http://lists.openmoko.org/pipermail/devel/2011-March/006998.html

Cheers,
Bernard.

u-boot-2010.12-beagle-dfu3.diff.gz

andy....@gmail.com

unread,
Mar 8, 2012, 11:42:41 PM3/8/12
to beagl...@googlegroups.com
Hi Bernard,

   How do I make this patch work? My system is a bit different as I am suing overo gumstix so I modified the omap3_overo.h with the lines below:

#define CONFIG_CMD_MTDPARTS    /* Enable MTD parts commands */
#define CONFIG_MTD_DEVICE    /* needed for mtdparts commands */

#define MTDIDS_DEFAULT            "nand0=nand"
#define MTDPARTS_DEFAULT        "mtdparts=nand:512k(x-loader),"\
                    "1920k(u-boot),128k(u-boot-env),"\
                    "4m(kernel),-(fs)"

/*
 * Board USB Info.
 */
/* USB */
#define CONFIG_MUSB_UDC            1
#define CONFIG_USB_OMAP3        1
#define CONFIG_TWL4030_USB        1

//#define CONFIG_USB_GADGET        1

/* USB device configuration */
#define CONFIG_USB_DEVICE        1
#define CONFIG_USB_TTY            1

#define CONFIG_USBD_DFU            1
#define CONFIG_USBD_DFU_XFER_SIZE     0x1000
#define CONFIG_USBD_DFU_INTERFACE    2

But still I cannot make it work with the dfu-util. he device is already being detected as Netchip U-boot 2011.12 by my Linux machine. But running dfu-util gives the logs below and no extra logs in u-boot console. Am I missing any step?

$ dfu-util -l
dfu-util - (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY


dfu-util does currently only support DFU version 1.0

Thanks and best regards,
Andy

andy....@gmail.com

unread,
Mar 12, 2012, 6:03:14 AM3/12/12
to beagl...@googlegroups.com
hi guys,

   finally got it working to download the images to the ram. how to make this DFU patch write directly to the nand partitions?

thanks and best regards,
andy

ljg

unread,
Mar 20, 2012, 6:14:48 AM3/20/12
to Beagle Board
Got it. Sorry for the bother.
Reply all
Reply to author
Forward
0 new messages