[dfu-util] Support for TI Stellaris patch

Tommi Keisala oss at tkeisala.net
Sat Jun 30 17:46:34 CEST 2012

On 06/30/2012 01:22 PM, Tormod Volden wrote:
> >  This add's prefix to the binary that
> Some explanation got cut off here...
It seems so. I think it should continue like "... gets flashed onto the 
device" =)
> So is the modified image file everything that is needed for these
> devices? Then I suggest you add this prefix in the dfu-suffix tool
> instead of in dfu-util.

Modified image seems to be enough. There is also dfuwrapper tool from TI 
that should be doing this but when I tried to flash wrapped image with 
dfu-util, I got some weird error message even though the image looks 
like it was flashed correctly. I don't see this issue with the dfu-util 
with my patch. I think it should work also modifying dfu-suffix.
> Is there a way to identify these Stellaris devices over USB? Then we
> could leave a check in dfu-util to make sure there is a prefix (and
> suffix) in the image for those devices.
Stellaris with "stock" bootloader identifies itself with a string and 
pair of ID's. So yes it is identifiable.
> There is also the dimension of compatibility with the "standard" tools
> for this device. If TI ships an official tool accepting a specific
> file format, and most users exchange files in this format, it might
> make sense for dfu-util to deal with this format and do whatever
> trickery needed before/while talking to the device.
Reason for not using "standard" tools was that they have been written 
for the Windows.
> I guess the usual exchange format would be raw binary (with address
> information handed over separately) or a complete "Stellaris" file
> with prefix and suffix included? Would anyone distribute files with
> suffix but not prefix?
No I don't think so. If I had to choose I'd do raw binary and address.
> I believe it was a deliberate design decision to keep dfu-util simple 
> as possible and focus on the communication with devices. Manipulating 
> files (without needing any interaction with a device) can be done in a 
> separate tool like dfu-suffix. This is maybe a cultural difference 
> between Windows style "my 600MB application is all you need" and 
> unix-style "small tools that do one thing well" BTW, this brings to 
> mind a TODO item for which patches would be very welcome: Separate out 
> functionality in a library with a well-thought API so that people can 
> easily build GUI's around the dfu-util "meat". A preliminary could be 
> to leave all file handling in main and pass firmware image array 
> pointers to the various download and suffix handling routines instead 
> of file handles. And device communication snippets dealing with 
> various state transitions. And so on... 
If that is design decision I agree and I will integrate my functionality 
to dfu-suffix tool.

Reason for me to to work in this tool is to get my Stellaris board 
flashed with Linux and opensource tools instead of proprietary Windows 

>> Correct. And dfu-suffix shares most of the code with dfu-util. I can 
>> take a
> Of course they share headers and functions when possible. But that is
> not an argument to merge them together.
I agree.
> I would rather see device-specific prefix juggling added to
> dfu-suffix. Unless Stefan approves your idea I would recommend you to
> hold off working on a code merge.

I just wanted to have one tool after compilation to get my code flashed. 
And also the name of the tool would no longer be valid if prefix 
juggling would be added. But I have no technical reasons not to add 
prefix functionality to dfu-suffix.

> The patch refers to an application note, but I was not able to find it
> on DuckDuckGo, Google nor Bing. Can you please provide a link? More
> information on the usual user pattern will also be good.

The document I was referring can be found from:

More information about the devel mailing list