2 include(stm32-stdperiph)
5 set(STM32F3_STDPERIPH_DIR "${MAIN_LIB_DIR}/main/STM32F3/Drivers/STM32F30x_StdPeriph_Driver")
6 set(STM32F3_CMSIS_DEVICE_DIR "${MAIN_LIB_DIR}/main/STM32F3/Drivers/CMSIS/Device/ST/STM32F30x")
7 set(STM32F3_CMSIS_DRIVERS_DIR "${MAIN_LIB_DIR}/main/STM32F3/Drivers/CMSIS")
8 set(STM32F3_VCP_DIR "${MAIN_SRC_DIR}/vcp")
10 set(STM32F3_STDPERIPH_SRC_EXCLUDES
14 set(STM32F3_STDPERIPH_SRC_DIR "${STM32F3_STDPERIPH_DIR}/src")
15 glob_except(STM32F3_STDPERIPH_SRC "${STM32F3_STDPERIPH_SRC_DIR}/*.c" "${STM32F3_STDPERIPH_SRC_EXCLUDES}")
18 main_sources(STM32F3_SRC
19 target/system_stm32f30x.c
21 config/config_streamer_stm32f3.c
23 drivers/adc_stm32f30x.c
24 drivers/bus_i2c_stm32f30x.c
25 drivers/dma_stm32f3xx.c
26 drivers/serial_uart_stm32f30x.c
27 drivers/system_stm32f30x.c
28 drivers/timer_impl_stdperiph.c
29 drivers/timer_stm32f30x.c
41 list(TRANSFORM STM32F3_VCP_SRC PREPEND "${STM32F3_VCP_DIR}/")
43 set(STM32F3_INCLUDE_DIRS
44 "${CMSIS_INCLUDE_DIR}"
45 "${CMSIS_DSP_INCLUDE_DIR}"
46 "${STM32F3_STDPERIPH_DIR}/inc"
47 "${STM32F3_CMSIS_DEVICE_DIR}"
48 "${STM32F3_CMSIS_DRIVERS_DIR}"
52 set(STM32F3_DEFINITIONS
53 ${CORTEX_M4F_DEFINITIONS}
58 set(STM32F303CC_DEFINITIONS
64 function(target_stm32f3xx)
65 # F3 targets don't support MSC and use -Os instead of -O2 to save size
67 SOURCES ${STM32_STDPERIPH_SRC} ${STM32F3_STDPERIPH_SRC} ${STM32F3_SRC}
68 COMPILE_DEFINITIONS ${STM32F3_DEFINITIONS}
69 COMPILE_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS}
70 INCLUDE_DIRECTORIES ${STM32F3_INCLUDE_DIRS}
71 LINK_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS}
73 VCP_SOURCES ${STM32F3_USB_SRC} ${STM32F3_VCP_SRC}
74 VCP_INCLUDE_DIRECTORIES ${STM32F3_USB_INCLUDE_DIRS}
80 OPENOCD_TARGET stm32f3x
86 function(target_stm32f303xc name)
89 STARTUP startup_stm32f30x_md_gcc.S
90 COMPILE_DEFINITIONS ${STM32F303CC_DEFINITIONS}
91 LINKER_SCRIPT stm32_flash_f303xc