Skip to main content
KPort
Associate II
March 30, 2026
Solved

STM32CubeMX2 + NUCLEO-C562RE - you need AI?

  • March 30, 2026
  • 5 replies
  • 856 views

Finally was able to test STM32CubeMX2 with a NUCLEO-C562RE board.
Simple LED blinking project, and here's what I found out.

Project bloat:
STM32CubeMX2: 26.2 MB of generated data and when compiled 41.1 MB (NUCLEO-C562RE)
STM32CubeMX: 4.6 MB generated and compiled 15.7 MB (NUCLEO-C031C6, same functionality)

The old STM32CubeMX included only the HAL libraries actually used.
The new one dumps everything in.
That's a 5.7x increase for a blink LED.

Missing Release configuration:
Generated CMake project contains only Debug configuration - No Release.
Interesting, because the official "MOOC STM32CubeMX2" video at 4:53 clearly shows both configurations.
Either something changed or the video is misleading.

Creating Release configuration manually requires editing multiple CMake files, including inside the cmake folder — supposedly overwritten on regeneration (in practice, changed only at project creation).
Not trivial if you're not a CMake expert.
I did it once manually, but then ended up using Claude Code AI to do it quickly again.

Linker files buried deep:
The .ld linker files are now hidden under several directory layers (previously at project root).
If you need separate linker configurations for Debug and Release — different memory layouts, for instance — good luck doing that without solid CMake knowledge.
Again, I had to ask AI for help. It's doable, but shouldn't be this complicated.

Bottom line:
The tools work.
If you don't have some CMake experience, will add extra friction.
But basic tasks like Release builds and linker customization shouldn't require AI assistance.

The new interface is fine, just needs getting used to — many settings have moved around.
But a designer tool should better handle these common workflows, not make them this complicated.

Suggestions:
Generate both Debug and Release configurations by default
Include only required HAL driver files
Make linker file customization more accessible

Best answer by MorkBeck

Hello @KPort 

We hear you on the Release configuration issue. That's being fixed in an upcoming update. You'll be able to choose Debug, Release, or both when generating your project.

Your points on HAL bloat and linker file accessibility are on our radar too. We're working to optimize these areas and make them less friction-heavy. On family support—for now, new chip families will be added to CubeMX2 going forward, while existing families remain supported in CubeMX.

We appreciate the constructive suggestions and will keep you posted on improvements.

5 replies

Andrew Neil
Super User
March 30, 2026

@KPort wrote:

STM32CubeMX2: 26.2 MB of generated data and when compiled 41.1 MB (NUCLEO-C562RE)
STM32CubeMX: 4.6 MB generated and compiled 15.7 MB (NUCLEO-C031C6, same functionality)


What, exactly, are you referring to here?

A C031C6 only has 32K flash - so the compiled image can't be 15.7 MB - surely?!

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
KPort
KPortAuthor
Associate II
March 30, 2026

Andrew, I was not measuring the compiled MCU image size.
I was measuring the disk space occupied after STM32CubeMX/MX2 file generation (before compilation) and after compiling for the first time.
That is, how much disk space was occupied in the generated projects.
Conclusion: STM32CubeMX2 creates LOTS of extra and totally unnecessary files.

Andrew Neil
Super User
March 30, 2026

I see.

 

In MX1 there was an option whether to copy all HAL files, or just the required ones.

 

Also, MX1 would download the entire FW pack the first time you used a part from that pack;  it just didn't put it all into the Project - it had a separate local "repository"

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
LCE
Principal II
March 30, 2026

@KPort Interesting!

Now that you're at it...

Have you compared the resulting image size? Does HAL 2 already blow up simple projects ?

Although this comparison would make more sense with the exactly same MCU.

TDK
Super User
March 30, 2026

My tests showed that, yes, it does compile significantly smaller. Mostly because the clock setup functions are not as general as they are in HAL/CubeMX. Can't do a 1:1 comparison of course. If your bootloader configures the clock and it's no longer in the default state when the application tries to configure it, it may fail with HAL2/MX2 code.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Pavel A.
Super User
March 31, 2026

You don't compare STM32C031 to C56, do you? STM32C56 is a CM33, with trustzone and lot of components. C0 is a small CM0+.

 

 

KPort
KPortAuthor
Associate II
March 31, 2026

I was not trying to compare head-to-head the run-time performance of these 2 MCUs.
I selected 2 families that could be configured with MX1 and MX2 (and I have both NUCLEO boards).
In MX2 you currently have only the STM32C5 family available, all the rest is in MX1.

I also wanted to select a family without TrustZone, since also STM32C5 does NOT have TrustZone!
Maybe I could have selected the STM32H5 for comparison, it's Cortex-M33 but with TrustZone.

Comparing STM32C5 to another family would not change much regarding the 3 observations in my post.

MorkBeckBest answer
ST Employee
April 7, 2026

Hello @KPort 

We hear you on the Release configuration issue. That's being fixed in an upcoming update. You'll be able to choose Debug, Release, or both when generating your project.

Your points on HAL bloat and linker file accessibility are on our radar too. We're working to optimize these areas and make them less friction-heavy. On family support—for now, new chip families will be added to CubeMX2 going forward, while existing families remain supported in CubeMX.

We appreciate the constructive suggestions and will keep you posted on improvements.

ST Employee
April 8, 2026

Hi @KPort 

As a complement to @MorkBeck 's reply, I’d like to confirm that we have an internal tracker open for the topic you raised: missing Release configuration.

Internal ticket numbers: CDM0061318.

I will keep you posted on its progress and on any updates that make it into upcoming releases.

Thank you again for your valuable feedback.

Sara.