From bfd80d5b5b5d52ee350969622f78e7e415f394cd Mon Sep 17 00:00:00 2001 From: Winford Date: Sun, 13 Oct 2024 22:15:34 -0700 Subject: [PATCH] Use newlib-nano by default for 512k flash STM32 boards For STM32 devices with 512k flash newlib-nano needs to be used otherwise the compiled binary is too large to leave space for user applications. Signed-off-by: Winford --- src/platforms/stm32/cmake/compile-flags.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platforms/stm32/cmake/compile-flags.cmake b/src/platforms/stm32/cmake/compile-flags.cmake index 1eeb5f6b5..759c0a2f7 100644 --- a/src/platforms/stm32/cmake/compile-flags.cmake +++ b/src/platforms/stm32/cmake/compile-flags.cmake @@ -36,6 +36,7 @@ set(CXX_WARN_FLAGS "${COMMON_WARN_FLAGS}") # Use C and C++ compiler optimizatons for size and speed. if (${CMAKE_FLASH_SIZE} STREQUAL "ROM_512K") set(OPTIMIZE_FLAG "-Os") +set(LINKER_FLAGS "${LINKER_FLAGS} -specs=nano.specs") else() set(OPTIMIZE_FLAG "-O2") endif()