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

 

1 REPLY 1
Souhaib MAZHOUD
ST Employee

Hello @peterdonchev 

Thank you for highlighting this issue.!

I will check this internally with the dedicated team and get back to you ASAP.

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.