cancel
Showing results for 
Search instead for 
Did you mean: 

DFuSe applet on Linux?

jingzhao
Associate
Posted on July 29, 2010 at 08:27

DFuSe applet on Linux?

#dfuse-v3.0.0 #stm32-dfu-usb #dfuse #dfuse-linux #dfuse-linux #dfu #linux
6 REPLIES 6
eldenc
Associate
Posted on May 17, 2011 at 14:00

It seems to work when used from a windows VM. (compiled in linux, windows dfuse to program)

But I don't think I have a valid compilation unit, Ie my dfu file is not correct for that processor.

stforum.tormod9
Associate II
Posted on May 17, 2011 at 14:00

''I know that STM provides a Windows based DFuSe applet for doing this. I wonder if there is any other alternatives for development on Linux platforms.''

I am also strongly interested in this. I tried the dfu-util from http://dfu-util.gnumonks.org/ before I understood that my device has DFUse which is not standard DFU.

However, dfu-util seems to get the download part right. It probably just lacks the erase part. I know I can read the all the code when I find the time, but does anyone know if only a few more steps are needed for DFUse downloading?

stforum.tormod9
Associate II
Posted on May 17, 2011 at 14:00

To answer my own question, I have looked up all the gory specification details, studied the available source code, snooped the Windows USB stream and hacked into the late hours. Finally I have a branch of the dfu-util code which supports downloading of DfuSe files onto DfuSe devices. Please find the code at

http://gitorious.org/~tormod/unofficial-clones/dfuse-dfu-util/commits/dfuse

and test it with: dfu-util --dfuse default -a 0 -D filename.dfu

It is not very sophisticated and it does not try to support DfuSe fully. For security it currently refuses to download below 0x08004000 where I have my bootloader. Probably there are a lot of bugs, but it works for me. Depending on feedback and contributions it might be more polished and feature-rich in the future.
rdraschwandtner
Associate II
Posted on May 17, 2011 at 14:00

How do you generate the .dfu image on a linux machine?

My problem is, that I have a .s19 file on a linux machine, but I don't know how to generate the .dfu image...

 

Posted on May 17, 2011 at 14:00

How do you generate the .dfu image on a linux machine?

 

 

My problem is, that I have a .s19 file on a linux machine, but I don't know how to generate the .dfu image...

Luckily for you ST publicly defined the structure of the DFU file. If a tool doesn't already exist, it be coded by your average C programmer in a afternoon.

http://www.lmgtfy.com/?q=st+dfu+format

If such a tool isn't readily available, how much would one be worth?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
stforum.tormod9
Associate II
Posted on May 17, 2011 at 14:00

Note that my above dfuse-enhanced dfu-util can upload .bin files directly to a dfuse device as long as you provide the target address[1]. So no need to create a .dfu file in that case. Use objcopy to convert between .s19 and .bin etc.

Here is a (python) tool to create or unpack .dfu files.

http://www.seeedstudio.com/forum/viewtopic.php?p=4504#p4504

BTW, these tools work fine on Mac OS X also.

[1]

http://garden.seeedstudio.com/index.php?title=Dfu-util