cancel
Showing results for 
Search instead for 
Did you mean: 

Loading multiple executables on the STM32 flash memory

wfarid
Associate II
Posted on January 21, 2011 at 23:41

Loading multiple executables on the STM32 flash memory

14 REPLIES 14
Posted on March 13, 2015 at 12:35

>> 'With BIN files you'll have to make you own application/linker/loader to represent the entire flash footprint,

>> and load the respective BIN files into their assorted position within that space, and then write that consolidated BIN file back out to another file.'

> This is exactly what I want to do with some binary files I've got. Rather than go and write my own application,

> I was just wondering if you (or anyone else) knew of an application that's already out there that might do the job?

Clive told you that already above: ''application/linker/loader''

For a simpler (but still powerful and specialized in certain ways) tool, check out srecord.

JW

Posted on March 13, 2015 at 13:11

There may be several general apps, you might find you have to reread the instructions every time you pick them up. As Jan mentions, srecords, is perhaps a good starting point and one that recognizes many input formats.

At a binary level I think of these as throw-away apps, something that can be coded in 5-10 minutes to perform a very specific task, I've coded hundreds of them, a lot of them historically did byte/word swapping, of byte/word splitting, to generate gold images for EPROM programmers, and run as part of the make process.

Generally such a tool will use C staples like fopen/fclose/fseek/fread/fwrite, malloc/free, memset/memcpy.

I've also built much more complicated solutions, that can take and output, hex and object files, and translate between formats.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jdcowpland
Associate II
Posted on March 13, 2015 at 17:49

In case anyone else is interested, I managed to achieve what I was after by creating a single dfu file out of the two binaries, programmed my arm chip with the dfuse app, and then extracted the binary from the chip using the ST Link, and voila- one single binary. Does the job.

jeff2
Associate
Posted on June 03, 2015 at 23:03

I'm working on combined DFU/CDC flash image and you can also just use dd to zero pad out the first bin file and then use cat to append the second bin file to create a single flash image. 

jeff

Posted on June 04, 2015 at 00:29

Probably, but I'd be tempted to code a small app to automate the work, basically padding out the the right size, and making sure everything fit in the right spots and is suitably checksummed.

In DOS two binary files can get concatenated with

COPY  /B  A.BIN+B.BIN  C.BIN

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