cancel
Showing results for 
Search instead for 
Did you mean: 

Bigger binary/ with CMake

Andrej Pi�ek
Associate

Hello,

We considered using the STM32 VScode extension for our next project but encountered a strange issue.

In cubeMX, I created an empty project for STM32U5G9J-DK2, with FreeRtos, NeoChrome and everything related.
When I built this project with CMake, flash usage exceeded 2MBs even when built with the "MinSizeRel" flag.

I found it a bit odd, so I tried other compilers.
CubeIDE managed to build it with ~250kB.
IAR with ~220kB

I thought the problem lies in NeoChrome libraries, but CMake and CubeIDE use the same.

No settings were changed during the tests, only project generation in CubeMX.
What could be causing this excess in consumption, which is almost 2MB?

I would much appreciate any advice.

Here are some additional details...
Changing optimisation levels didn't make more than 50kB of difference for any compiler.

IAR with no optimisation:

image-20240529-121554.png

CubeIDE for Debug:

image-20240529-125826.png

 CMake optimised for size:

image-20240529-123910.png

Regards,
Andrej

1 REPLY 1
Nawres GHARBI
ST Employee

Hi @Andrej Pi�ek 

could you share your project please we are interested to test the build in our env