From 2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 15 Jan 2017 15:04:02 +0100 Subject: o Adding a generic binutils part for creating the info files (.nm, disassembly, size, hex and bin files.) o Adding initial support for STM32F103xx chips. Can easily be expanded to all at least the F1 series. --- stm32f103/toolchain.cmake | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 stm32f103/toolchain.cmake (limited to 'stm32f103/toolchain.cmake') diff --git a/stm32f103/toolchain.cmake b/stm32f103/toolchain.cmake new file mode 100644 index 0000000..2a0e5b8 --- /dev/null +++ b/stm32f103/toolchain.cmake @@ -0,0 +1,26 @@ +find_program(MCU_ARM_CC arm-none-eabi-gcc ${MCU_TOOLCHAIN_DIR}/bin) +find_program(MCU_ARM_CXX arm-none-eabi-g++ ${MCU_TOOLCHAIN_DIR}/bin) +find_program(MCU_ARM_OBJCOPY arm-none-eabi-objcopy ${MCU_TOOLCHAIN_DIR}/bin) +find_program(MCU_ARM_OBJDUMP arm-none-eabi-objdump ${MCU_TOOLCHAIN_DIR}/bin) +find_program(MCU_ARM_READELF arm-none-eabi-readelf ${MCU_TOOLCHAIN_DIR}/bin) +find_program(MCU_ARM_SIZE arm-none-eabi-size ${MCU_TOOLCHAIN_DIR}/bin) +find_program(MCU_ARM_NM arm-none-eabi-nm ${MCU_TOOLCHAIN_DIR}/bin) + +#message("MCU_ARM_CC = ${MCU_ARM_CC}") +#message("MCU_ARM_CXX = ${MCU_ARM_CXX}") +#message("MCU_ARM_OBJCOPY = ${MCU_ARM_OBJCOPY}") +#message("MCU_ARM_SIZE = ${MCU_ARM_SIZE}") + +set(_CMAKE_TOOLCHAIN_PREFIX arm-none-eabi-) +include(CMakeFindBinUtils) + +if (NOT MCU_ARM_CC OR NOT MCU_ARM_CXX OR NOT MCU_ARM_OBJCOPY OR NOT MCU_ARM_SIZE) + message(FATAL_ERROR "Could not find required compiler tools.") +endif() + +set(CMAKE_C_COMPILER ${MCU_ARM_CC} CACHE FILE "") +set(CMAKE_CXX_COMPILER ${MCU_ARM_CXX} CACHE FILE "") +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) -- cgit v1.2.3