How different are dfu-util and dfu-programmer?

Harald Welte laforge at openmoko.org
Tue Jan 29 02:41:41 CET 2008


On Tue, Jan 29, 2008 at 12:40:38AM +0100, Torsten Schlabach wrote:
> Dear Harald!
>
> I started to work on a Debian package for dfu-util today, but stubled  
> over this comment in the source code:
>
> /*
>  * dfu-util
>  *
>  * (C) 2007 by OpenMoko, Inc.
>  * Written by Harald Welte <laforge at openmoko.org>
>  *
>  * Based on existing code of dfu-programmer-0.4
>  *
>
> I guess dfu-programmer is http://dfu-programmer.sourceforge.net/?

that's true.

> Could you briefly explain what the major differences / incompatible  
> changes are which you made to dfu-programmer to create dfu-util? Would  
> it be possible to re-unite dfu-programmer and dfu-utils?

not easily.  Basically the situation is like this (in chronological
order)

1) the USB forum created a USB DFU spec
2) microcontroller vendors (such as atmel) with built-in USB
   device decided to toss away almost all of the DFU spec and implement
   a chip-specific proprietary variant, while still calling it DFU
3) the author of the original dfu-programmer came along and implemented
   the various proprietary bits for the various microcontrollers
4) I started to work on a clean as-per-spec implementation of DFU
   for openpcd (http://www.openpcd.org/) and used the dfu-programmer
   code as a basis.  It turned out an ugly hack, since the protocol
   differences are rather big, actually too big
5) When I implmented DFU once again in the OpenMoko u-boot variant,
   I decided to do a rewrite of an entirely new dfu commandline tool,
   that works only with clean, dfu-compliant devices such as openpcd,
   openmoko and some CSR bluetooth chips.

> The Debian folks will ask why dfu-util should exist next to  
> dfu-programmer (wich is in unstabled and testing already).

feel free to explain them what I just wrote.  To me personally,
dfu-programmer is actually a misnomer, since it is very far from what
the original USB DFU spec says.  The idea of the DFU protocol as
describe in the spec is: You can have one DFU software that will support
all DFU capable devices.  The way how the microcontroller vendors
implemented it completely circumvents that goal.  every device needs its
own specific hacks.

The comment in the code referring to dfu-programmer should be mostly
cosmetic by now (and should still remain since it is always good style
to refer to code that was originally used for new code), but AFAIR
almost everything has been rewritten over time.

Cheers,
-- 
- Harald Welte <laforge at openmoko.org>          	        http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone



More information about the device-owners mailing list