cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX CMake generator newlib-nano bug

peterdonchev
Senior

Hello,

I have observed this issue in version 6.16.1 across several MCU series (F3, F4, H5, H7), though it appears likely that all earlier versions are affected.

The generated .cmake toolchain files incorrectly treat the --specs=nano.specs option as linker-only. This option should be applied globally, as it also affects the system include paths used during compilation. Specifically, it causes the compiler to include arm-none-eabi/include/newlib-nano/newlib.h instead of the standard arm-none-eabi/include/newlib.h.

While this mismatch probably does not break ABI compatibility—since the structures provided from the standard headers are larger than those used in the compiled newlib-nano library—it does negate the RAM usage benefits of newlib-nano. This is particularly problematic when using the USE_NEWLIB_REENTRANT FreeRTOS option.

Regards,
Peter

 

12 REPLIES 12

Great! Works perfectly. Thanks!

Nice! Perhaps STM32CubeMX should be modified to generate the gcc-arm-none-eabi.cmake file like this too.

Hello @Erlkoenig 

Thank you for posting the workaround,
In fact, this issue is raised internally to dedicated team for further investigation. (Ticket 225091 This is an internal tracking number and is not accessible or usable by customers).)

KR, Souhaib

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.