|
| 1 | +## |
| 2 | +## ______ _ |
| 3 | +## / _____) _ | | |
| 4 | +## ( (____ _____ ____ _| |_ _____ ____| |__ |
| 5 | +## \____ \| ___ | (_ _) ___ |/ ___) _ \ |
| 6 | +## _____) ) ____| | | || |_| ____( (___| | | | |
| 7 | +## (______/|_____)_|_|_| \__)_____)\____)_| |_| |
| 8 | +## (C)2013-2017 Semtech |
| 9 | +## ___ _____ _ ___ _ _____ ___ ___ ___ ___ |
| 10 | +## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| |
| 11 | +## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| |
| 12 | +## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| |
| 13 | +## embedded.connectivity.solutions.============== |
| 14 | +## |
| 15 | +## License: Revised BSD License, see LICENSE.TXT file included in the project |
| 16 | +## Authors: Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech ) |
| 17 | +## |
| 18 | +## |
| 19 | +## STM32L1 target specific CMake file |
| 20 | +## |
| 21 | + |
| 22 | +if(NOT DEFINED LINKER_SCRIPT) |
| 23 | +message(FATAL_ERROR "No linker script defined") |
| 24 | +endif(NOT DEFINED LINKER_SCRIPT) |
| 25 | +message("Linker script: ${LINKER_SCRIPT}") |
| 26 | + |
| 27 | + |
| 28 | +#--------------------------------------------------------------------------------------- |
| 29 | +# Set compiler/linker flags |
| 30 | +#--------------------------------------------------------------------------------------- |
| 31 | + |
| 32 | +set(STACK_SIZE 2048) |
| 33 | +set(APP_HEAP_SIZE 1024) |
| 34 | +set(KERNEL_HEAP_SIZE 1024) |
| 35 | + |
| 36 | +# Object build options |
| 37 | +set(OBJECT_GEN_FLAGS "-mthumb -g2 -fno-builtin -mcpu=cortex-m4 -Wall -Wextra -pedantic -Wno-unused-parameter -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize -frecord-gcc-switches -gdwarf-2 -Os -fdata-sections -ffunction-sections -fstack-usage -Wl,--emit-relocs -fPIC -mthumb -mfloat-abi=soft -msingle-pic-base -mpic-register=r9 -mno-pic-data-is-text-relative -D__TOCK__ -DSVCALL_AS_NORMAL_FUNCTION -DSOFTDEVICE_s130") |
| 38 | + |
| 39 | +set(CMAKE_C_FLAGS "${OBJECT_GEN_FLAGS} -std=gnu99 " CACHE INTERNAL "C Compiler options") |
| 40 | +set(CMAKE_CXX_FLAGS "${OBJECT_GEN_FLAGS} -std=c++11 " CACHE INTERNAL "C++ Compiler options") |
| 41 | +set(CMAKE_ASM_FLAGS "${OBJECT_GEN_FLAGS} -x assembler-with-cpp " CACHE INTERNAL "ASM Compiler options") |
| 42 | + |
| 43 | +# Linker flags |
| 44 | +set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections --specs=nano.specs --specs=nosys.specs -mthumb -g2 -mcpu=cortex-m4 -mabi=aapcs -T${LINKER_SCRIPT} -Wl,-Map=${CMAKE_PROJECT_NAME}.map -Xlinker --defsym=STACK_SIZE=${STACK_SIZE} -Xlinker --defsym=APP_HEAP_SIZE=${APP_HEAP_SIZE} -Xlinker --defsym=KERNEL_HEAP_SIZE=${KERNEL_HEAP_SIZE} -nostdlib -Wl,--start-group" CACHE INTERNAL "Linker options") |
0 commit comments