Stm32 Dfu File Converter

Photo of Muls96

Made by Muls96

About the project

Command Line Executable for Easy DFU Upload

Project info

Difficulty: Easy

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)


µCs can be programmed in many ways. There's the traditional JTAG debug probe, but it’s also usually possible to program via a serial port or other communication interface. There's a specification for this type of programming called Device Firmware Update, or DFU for short. STmicroelectronics came with a version of DFU called DFUSE. I'm using it to program my custom board through USB. But to convert the file in *.dfu and load it you have to go through a lot of steps and clicks. This is really annoying when you're debugging a program. My idea was to automate the process with a commandline executable that will be launched by KEIL IDE at the end of the build.


Step 1

Install the DFU driver located in the Driver folder of the software package

Step 2

Your device is ready, let's setup the IDE to load automatically the program. Here I'm going to use Keil IDE. Open the project settings dialog in Project>Options for target 'XXX'. In the Output tab select create hex file. Build your project once and locate the *.hex file in your project directory.

Step 3

Plug in your DFU device, make sure it's in DFU mode. If your driver is installed and the device connected, you should see a DFU device in your peripheral manager.

Step 4

Congratulations Your IDE is now ready ! Build your program and check the Build Output, it should say "Upgrade Sucessful !".

Step 5

Copy the contents of the Tools folder of the software package in the directory. Return in the projects settings dialog at the User tab. In the section Programs After Build/Rebuild activate Run#1 and browse to the load.bat file in the hex file directory.


Photo of Muls96



Leave your feedback...