cancel
Showing results for 
Search instead for 
Did you mean: 

How to put a binary file into a specific address of Flash?

Tai.Cheng Chung
Associate II
Posted on December 30, 2014 at 10:23

Hi:

 Is there any way to put a binary file (for example, a bitmap file) into a specific address so the project can read it from flash? Is there any example show how to do it?
1 REPLY 1
Posted on December 30, 2014 at 14:51

There are lots of ways to do such things. Do you have any experience with C and File IO (fopen/fclose/fread/fwrite/fseek etc)?

Using existing tools, probably you'd want to use things like BMPCVT, etc to convert binary data into a C data array which you can then include in your compile. For specific address placement you likely have #pragma or attribute directives either to specify addresses, or sections, to place the data. The secondary route would be via a linker script or scatter file to direct the output of specific sections or object files to memory.

Just taking straight binary you can specify addresses with ST-LINK or DFU Manager and manage placement that way.

If you have custom requirements you might want to consider processing the data components yourself with a script and packaging application. For file system type constructs, looks at MAKEFSDATA, part of LwIP as I recall. For hex data output SRECORDS

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