Skip to main content
LTuye.1
Associate
August 7, 2022
Solved

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

  • August 7, 2022
  • 5 replies
  • 1438 views

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?

This topic has been closed for replies.
Best answer by Tesla DeLorean

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

5 replies

Tesla DeLorean
Guru
August 7, 2022

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
LTuye.1
LTuye.1Author
Associate
August 7, 2022

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

Pavel A.
August 7, 2022

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.