cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE V1.9.0 compile size significantly larger than V1.4.0

David Koster
Associate II

I'm working on an STM32L031 project together with a client, me being on an old V1.4 and him on V1.9. He's been able to compile my firmware for quite some time, but now I'm running close to the end of my flash (70%) he's unable to properly compile the code, running out of flash by 88 bytes.

The project settings all seem the same, only the IDE installation is different - Installing V1.9.0 on my machine has the same problem.

Looking at the memory details there seem to be a number of extra functions taking space, for example _vfiprintf_r and _vfprintf_r.

Does anyone know what's up here? And how to circumvent this? I'd love to stay on an up to date version of the IDE but I have to be able to compile my code.

Thanks!

6 REPLIES 6
Paul1
Lead

Check you have same compiler settings.

  • There are settings for printf libraries, minimal or larger to support floating point.
  • Maybe they are set to different optimization levels (May be using Optimization 0 during debugging).
  • The settings are in IDE under project properties. Personally I screen capture all the windows of settings and save with my projects, just for cases like this.

Paul

mattias norlander
ST Employee

Not sure about the details on the c libraries without having a project to look at.

But, what strikes me is that if you only want to have "an up to date version of the IDE", then you can use the 1.9.0 version of the "IDE". But stick with the old toolchain.

The toolchain manager allows you to de-couple "IDE" from "toolchain". Very useful when you want to "freeze your code and tools".

Have a look at Window > Preferences > STM32Cube > Toolchain Manager, allows you to download old toolchains.

You can do that if you wish also to just build with the different toolchain version and compare GCC7 / GCC9 / GCC10.

Have a look at UM2609 and the Toolchain Manager chapter.

Between some IDE version the "integration" of the toolchain (on IDE side) has also changed. So it is possible that we have new default settings that will slightly enlarge the code too (even if you use the same GCC version).

Conequently it is not entirely true to say that the IDE is fully de-coupled from the toolchain.

You can fully decouple by writing your own makefile and use whatever make + toolchain version you want. But that is not your original question... :)

mattias norlander
ST Employee

Cannot find anything in the toolchain integration that would change this. The safe bet is to use CubIDE 1.9.0 with GCC7 if you want to re-produce the same sized binary.

Let us know if that solves your issue or not.

mattias norlander
ST Employee

C or C++ project?

Does the STM32L031 have the 16 or 32KByte flash memory?

Bare-metal or RTOS application?

David Koster
Associate II

Thanks for all the replies Mattias!

Installing and selecting the "GNU Tools for STM32 (7-2018-q2-update)" as a toolchain in the IDE V1.9.0 results in the exact same file size as on the IDE V1.4.0. I've never known how this worked, thanks for shedding a lot of light on this for me as well as circumventing my problem. :)

For the rest, it's a Bare-metal C++ project on the 32kB flash version. I'm still curious why the file size would increase by over 30% with the same optimization, but at least I can continue working in the new IDE knowing what does what.

Much appreciated!

David

Piranha
Chief II

Also take a look on additional information about printf() functions and firmware size optimization overall:

https://community.st.com/s/question/0D53W00001FT7OdSAL/problem-with-optimal-code-size