AnsweredAssumed Answered

STM32L0 vs STM32F0 huge difference in base code size

Question asked by Anders Dam Kofoed on Dec 11, 2016
Latest reply on Dec 14, 2016 by Clive One

HI All,
I am wondering why initial code size differs with a factor of 3 between the STM32F031K6 and the STM32L031K6 - just for making an LED blink.

 

I use CubeMx to generate the project and GCC (OpenSTM32 AC6 IDE) to compile it. In CubeMX I select the Nucleo-F031K6 and the Nucleo-L031K6 and click the "Initialize all peripherals with their default mode". Then I leave everything as default, just enough to make the LD3 blink (PB3).

 

Compiling the project without any modification gives me the following code size:

 

== STM32L031K6 ==
arm-none-eabi-size "TEST-L0.elf"
text data bss dec hex filename
12504 12 1684 14200 3778 TEST-L0.elf

 

== STM32F031K6 ==
arm-none-eabi-size "TEST-F0.elf"
text data bss dec hex filename
4536 12 1684 6232 1858 TEST-F0.elf

 


== Question ==
Why this huge difference in code size between the L0 (12,5 KB) and the F0 (4,5 KB) ?

 

Kind regards
Anders

Outcomes