cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a DFU file from Hex from bat

KHans.5
Associate

I want to be able to run a bat file that has inside it the path to a hex file. When i run it, it converts it to a dfu file, without the user needing to do any more clicks or inputs.

I tried to do this by using encedo's hex2dfu from github. The problem is that it formats the dfu file differently from the DFU file manager. There are giant areas of no data (empty with FF) and the encedo treats the entire hex file as one image element. But the DFU file manager splits up my hex file into 4 image elements.

How do i edite the hex2dfu program to behave like the DFU file manager? Or is the source code for the DFU file manager available somewhere? Or is there some documentation on how to convert hex to dfu?

1 REPLY 1

The DFU format was well documented, I wrote a conversion tool based on it.

You'd need heuristics to decompose or identify the void/sparse areas.

If you have multiple regions of FLASH, ie internal vs QSPI, using a .ELF object might do a lot of the work.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..