cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMx size of generated code problem

Serge Lopez
Associate II
Posted on December 21, 2017 at 14:44

I am wroking on a project  using two microcontrollers a STM32F412 and a STM32L011 (8K flash, 2k RAM) .The STM32L011 is used as RTC to manage the power comsumption of the STM32F412. 

I used STM32CubeMx to generate the code to set the peripherics  that I use within the L011 (I2C, RTC, RCC). The problem is the size of the generated code once compiled is bigger than the 8k available inside the flash of the L011.

I only compile the genretaded code without writting a line of code.!

How could be possible to get a bigger code than the place to stored it for a defined STM32?

I think I did something wrong but I can find what is wrong.

Someone could provide me any ideas to resolve this situation. (i can not change the micro)

You will find in attachment the .ioc file. The genrated code from STM32Cube Mx is trasnfered on  a Eclipse platform 

and is used GNU ARM tools.

.Thanks in advance for your help

Best regards

Serge LOPEZ

#stm32cubemx #stm32l0xx #program-size
25 REPLIES 25
Posted on January 22, 2018 at 15:23

Hello Andrew

Thanks for your answer

I does't use floating point 

Posted on January 22, 2018 at 15:25

Hello Rosiney,

I found this panel. I modified the value but not change.

I tried to modify the optimisation option of the compiler. I removed optimization about digned char. the code size has been reduced . It 's a start point.

Thanks for your help

kind regards

Serge

Posted on January 22, 2018 at 15:26

Hello Bogdan,

Thanks for your suggestion 

I will go in this way

Kinds regards

Serge

Posted on January 22, 2018 at 15:28

Thanks Syzmon,

Posted on January 22, 2018 at 16:59

Even if you don't use it in your own code, note my parenthesis:

(and beware that Cube/HAL isn't sneaking it in through the back door)

a certain other manufacturer's equivalent of the ST HAL has been found guilty of doing this ...

Posted on January 22, 2018 at 17:27

Or that code isn't pulling in the floating point and assorted math library code on the Cortex-M0 side.

The consequence of using the CM0 is that your code will bulk up to carry the silicon you are saving in the core.

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