cancel
Showing results for 
Search instead for 
Did you mean: 

BSS and DATA size too big

matheusmbar
Associate II
Posted on November 22, 2016 at 01:38

Hello 

I'm developing code for a STM32F031G6 on System Workbench. This microcontroller has 4KB of SRAM but after compiling my code (even with a empty main loop and nothing else declared) I get the following code size as output of my Build process:

make --no-print-directory post-build

Generating binary and Printing size information:

arm-none-eabi-objcopy -O binary ''teste.elf'' ''teste.bin''

arm-none-eabi-size ''teste.elf''

   text   data    bss    dec    hex filename

    984   1076   1056   3116    c2c teste.elf

Why are the DATA and BSS sections filling more than 2KB of my ram if my source code has just an empty main() function?

I've been trying to find something about this matter with no success for a couple days. 

#stm32
3 REPLIES 3
Posted on November 22, 2016 at 04:44

Could you review the .MAP file? Or a disassembly?

Is there any heap allocation?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on November 22, 2016 at 08:04

Semihosting? RTOS?

JW
Radosław
Senior II
Posted on November 22, 2016 at 09:03

in bss will be stack, but data? hard to know, very stange. 

by size tool get size for all objects. look to map file.