cancel
Showing results for 
Search instead for 
Did you mean: 

why the code lay on QSPI ExtFlash made the ".bin" file too large?

LTuye.1
Associate

I have a project that contained UI design using TouchGFX. Almost the code auto-generated by TouchGFX for STM32CubeIDE is lay on QSPI external flash. And after built in CubeIDE, I saw .bin file of project around ~2GB

So, I try to relocate all the section pointed to QSPI external Flash to Flash region by using Linker file. After that, .bin file have been built around 900KB

So what is the problem here? why the code lay on QSPI ExtFlash made the ".bin" file too large?

1 ACCEPTED SOLUTION

Accepted Solutions

It's a topic that's been covered on forum several time.

I think objcopy has a command line option to check pick particular sections to extract.

.HEX files are sparse, describing addresses related to data lines.

In Keil one can use FROMELF tools, and this can extracts multiple binaries into different directories.

https://community.st.com/s/question/0D53W00000PpuUgSAJ/split-bin-in-multiple-regions

https://www.google.com/search?q=sym32+objcopy+multiple+sections

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

View solution in original post

5 REPLIES 5

Because the different memory regions described to the linker span vast distances.

You need to keep it in an object form, or split into multiple binaries.

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

How can I build 2 binary file in STM32CubeIDE, thanks.

You can run objcopy two times to produce a .bin, one time remove the section that holds the external memory; another time extract only that section.

You can also produce a hex file.

It's a topic that's been covered on forum several time.

I think objcopy has a command line option to check pick particular sections to extract.

.HEX files are sparse, describing addresses related to data lines.

In Keil one can use FROMELF tools, and this can extracts multiple binaries into different directories.

https://community.st.com/s/question/0D53W00000PpuUgSAJ/split-bin-in-multiple-regions

https://www.google.com/search?q=sym32+objcopy+multiple+sections

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

And IAR has ielftool, it can extract all spans of an ELF file at once. with option --bin-multi. This is handy if you don't remember section names, or if a section is sparse.