From c0faa2322fd12c0f7a68fa4784e3277014b71a77 Mon Sep 17 00:00:00 2001 From: jake Date: Thu, 7 Nov 2024 00:36:49 -0800 Subject: [PATCH] Created STM32 toolchain file Created an toolchain file `stm32-toolchain.cmake` in the root dir of the repo. --- stm32-toolchain.cmake | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 stm32-toolchain.cmake diff --git a/stm32-toolchain.cmake b/stm32-toolchain.cmake new file mode 100644 index 0000000..83b1aea --- /dev/null +++ b/stm32-toolchain.cmake @@ -0,0 +1,36 @@ +# ############################### +# STM32 toolchain file +# ############################### + +# Specify the cross-compiler +set(CROSS_TOOLCHAIN arm-none-eabi-) +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR arm) +set(CMAKE_CROSSCOMPILING 1) +set(CMAKE_SYSTEM_VERSION 1) + +# Specify the exact Chip + + +# Programmer and debugging +set(PROGRAMMER serialupdi) +set(PORT /dev/ttyU0) + + +# Define the toolchain executables +set(CMAKE_C_COMPILER avr-gcc) +set(CMAKE_CXX_COMPILER avr-g++) +set(CMAKE_ASM_COMPILER avr-gcc) +set(CMAKE_LINKER avr-ld) +set(CMAKE_OBJCOPY avr-objcopy) +set(CMAKE_SIZE avr-size) + + + + +# Define compile options +set(CMAKE_C_FLAGS " -Os -mmcu=${AVR_MCU} -DF_CPU=${F_CPU}") +set(CMAKE_CXX_FLAGS "-mmcu=${AVR_MCU} -DF_CPU=${F_CPU}") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-mmcu=${AVR_MCU}") + +