You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
45 lines
1.3 KiB
set(CPU_MCU "-mcpu=cortex-m0")
|
|
|
|
set(IDIR_BIN "/home/key/Git/ked/bsl/nucleo_f042k6/bin")
|
|
set(IDIR_LIB "/home/key/Git/ked/bsl/nucleo_f042k6/lib")
|
|
set(IDIR_INC "/home/key/Git/ked/bsl/nucleo_f042k6/inc")
|
|
|
|
# For flags please check https://manned.org/arm-none-eabi-gcc/34fd6095
|
|
set(C_FLAGS
|
|
${CPU_MCU}
|
|
-mthumb #Instruction set : https://stackoverflow.com/questions/10638130/what-is-the-arm-thumb-instruction-set
|
|
-Wall #Error : If you don't know this one please chek basical compiling
|
|
-fdata-sections #Optimization : Linker can perform optimizations to improve locality of reference in the instruction space.
|
|
-fdiagnostics-color=always
|
|
-ffunction-sections #Optimization : used with -fdata-sections
|
|
$<$<CONFIG:Debug>:-O -g -gdwarf-2>)
|
|
|
|
set(C_DEFS
|
|
-DUSE_FULL_LL_DRIVER
|
|
-DSTM32F042x6
|
|
-DHSE_VALUE=8000000
|
|
-DHSE_STARTUP_TIMEOUT=100
|
|
-DLSE_STARTUP_TIMEOUT=5000
|
|
-DLSE_VALUE=32768
|
|
-DHSI_VALUE=8000000
|
|
-DLSI_VALUE=40000
|
|
-DVDD_VALUE=3300
|
|
-DPREFETCH_ENABLE=1
|
|
-DINSTRUCTION_CACHE_ENABLE=0
|
|
-DDATA_CACHE_ENABLE=0)
|
|
|
|
set (CPP_INCLUDES .)#${C_INCLUDES} )
|
|
set (CPP_FLAGS ${C_FLAGS})
|
|
set (CPP_DEFS ${C_DEFS})
|
|
|
|
set(LINKER_FLAGS
|
|
${CPU_MCU}
|
|
-mthumb
|
|
-specs=nano.specs
|
|
-T${CMAKE_SOURCE_DIR}/${LINKER}
|
|
-lc
|
|
-lm
|
|
-lnosys
|
|
-Wl,-Map=${PROJECT_NAME}.map,--cref
|
|
-Wl,--gc-sections)
|