cancel
Showing results for 
Search instead for 
Did you mean: 

Generated binary file size in STM32L4

AP_040
Senior

Is there any specific address location in generated binary file so we can know the size of that binary file?

Using this, in the firmware to read the size of binary file from that location and use it in our application.

65 REPLIES 65

I'll really not looking to tutorialize the GNU Linker/Scripts, I'm sure this is all documented, and these aren't novel concepts.

https://community.st.com/s/question/0D50X0000B44pX7SQI/how-can-i-define-a-sdram-usage-in-the-script-linker

See how your RAM sections use "AT> FLASH" it's how the linker stores initialized content that ends up in RAM to the FLASH memory, so that the code in startup.s can unpack it. The addresses for the symbols describe RAM addresses, the content behind them has to be stored somewhere NON-VOLATILE, and copied there.

Perhaps more importantly consider why you have this initialized data in SDRAM

For a more transparent solution consider using Keil, it manages these initialization sections in tables, and supplies code to automatically unpack or decompress them.

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

Hello @Community member​ 

Thank you very much for your answers and the link.

As I understand I should define the EXTRAM_REGION section as NOLOAD.

Can you please explain if I need to define a section in RAM that should not be initialized at reset time (warm reset: e.g. watchdog, software reset) how should define it in linker file?

Yacob Hassidim.

Hello @Community member​ 

I tried the NOLOAD type and it solved the problem of huge size of the binary file (thanks to you)

I am waiting for explanation how to define a section in RAM that should not be initialized at reset time.

Yacob Hassidim.

Hello @Community member​ 

I found the NOLOAD also means "not initialized".

See https://mcuoneclipse.com/2014/04/19/gnu-linker-can-you-not-initialize-my-variable/.

Thanks anyway for your support.

Yacob Hassidim.

I have the same problem. Any updates/ideas?

Start a NEW thread, explain YOUR problem, link to this monster thread if you must.

.BIN files will be huge if you describe memory areas which are massively disparate within the memory map. DON'T DO THAT

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