diff --git a/src/modm/platform/clock/stm32/rcc.cpp.in b/src/modm/platform/clock/stm32/rcc.cpp.in index 3e1c73ae44..7cd40d1661 100644 --- a/src/modm/platform/clock/stm32/rcc.cpp.in +++ b/src/modm/platform/clock/stm32/rcc.cpp.in @@ -23,8 +23,8 @@ modm_weak void SystemCoreClockUpdate() { /* Nothing to update */ } namespace modm::platform { -constinit uint16_t modm_fastdata delay_fcpu_MHz(computeDelayMhz(Rcc::BootFrequency)); -constinit uint16_t modm_fastdata delay_ns_per_loop(computeDelayNsPerLoop(Rcc::BootFrequency)); +constinit uint16_t modm_fastdata modm_used delay_fcpu_MHz(computeDelayMhz(Rcc::BootFrequency)); +constinit uint16_t modm_fastdata modm_used delay_ns_per_loop(computeDelayNsPerLoop(Rcc::BootFrequency)); // ---------------------------------------------------------------------------- %% if target.family == "f0" diff --git a/src/modm/platform/core/cortex/vectors.c.in b/src/modm/platform/core/cortex/vectors.c.in index 907b064e19..c7002ec874 100644 --- a/src/modm/platform/core/cortex/vectors.c.in +++ b/src/modm/platform/core/cortex/vectors.c.in @@ -33,7 +33,7 @@ typedef void (* const FunctionPointer)(void); extern uint32_t __main_stack_top[]; // Define the vector table -modm_section(".vector_rom") +modm_section(".vector_rom") modm_used FunctionPointer vectorsRom[] = { (FunctionPointer)__main_stack_top, // -16: stack pointer @@ -50,7 +50,7 @@ FunctionPointer vectorsRom[] = }; %% if vector_table_location == "ram" // reserve space for the remapped vector table in RAM -modm_section(".vector_ram") +modm_section(".vector_ram") modm_used FunctionPointer vectorsRam[sizeof(vectorsRom) / sizeof(FunctionPointer)]; %% endif @@ -65,7 +65,8 @@ FunctionPointer vectorsRam[sizeof(vectorsRom) / sizeof(FunctionPointer)]; #include %% endif -void Undefined_Handler(void) +modm_used void +Undefined_Handler(void) { %% if with_assert const int32_t irqn = ((int32_t)__get_IPSR()) - 16; diff --git a/src/modm/platform/heap/cortex/heap_newlib.cpp b/src/modm/platform/heap/cortex/heap_newlib.cpp index 0987802536..83d1a506a9 100644 --- a/src/modm/platform/heap/cortex/heap_newlib.cpp +++ b/src/modm/platform/heap/cortex/heap_newlib.cpp @@ -40,7 +40,7 @@ void __modm_initialize_memory(void) * Note: This implementation is not thread safe (despite taking a * _reent structure as a parameter). */ -void * +modm_used void * _sbrk_r(struct _reent *, ptrdiff_t size) { const uint8_t *const heap = heap_top; diff --git a/src/modm/platform/heap/cortex/no_heap.c.in b/src/modm/platform/heap/cortex/no_heap.c.in index 4c963b885e..273d18f4e0 100644 --- a/src/modm/platform/heap/cortex/no_heap.c.in +++ b/src/modm/platform/heap/cortex/no_heap.c.in @@ -19,7 +19,7 @@ void __modm_initialize_memory(void) } // ---------------------------------------------------------------------------- -modm_weak modm_section("{{ no_heap_section }}") +modm_weak modm_used modm_section("{{ no_heap_section }}") void* _sbrk_r(struct _reent *r, ptrdiff_t size) { (void) r; diff --git a/tools/build_script_generator/cmake/resources/ci_CMakeLists.txt.in b/tools/build_script_generator/cmake/resources/ci_CMakeLists.txt.in index cf68aeea18..4d44b499cd 100644 --- a/tools/build_script_generator/cmake/resources/ci_CMakeLists.txt.in +++ b/tools/build_script_generator/cmake/resources/ci_CMakeLists.txt.in @@ -41,6 +41,11 @@ set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}-objdump) set(CMAKE_AR ${TOOLCHAIN_PREFIX}-gcc-ar) set(CMAKE_NM ${TOOLCHAIN_PREFIX}-gcc-nm) +SET(CMAKE_C_ARCHIVE_CREATE " qcs ") +SET(CMAKE_C_ARCHIVE_FINISH ":") +SET(CMAKE_CXX_ARCHIVE_CREATE " qcs ") +SET(CMAKE_CXX_ARCHIVE_FINISH ":") + project({{ project_name }} CXX C) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)