2 include(stm32-stdperiph)
5 set(STM32F4_STDPERIPH_DIR "${MAIN_LIB_DIR}/main/STM32F4/Drivers/STM32F4xx_StdPeriph_Driver")
6 set(STM32F4_CMSIS_DEVICE_DIR "${MAIN_LIB_DIR}/main/STM32F4/Drivers/CMSIS/Device/ST/STM32F4xx")
7 set(STM32F4_CMSIS_DRIVERS_DIR "${MAIN_LIB_DIR}/main/STM32F4/Drivers/CMSIS")
8 set(STM32F4_VCP_DIR "${MAIN_SRC_DIR}/vcpf4")
10 set(STM32F4_STDPERIPH_SRC_EXCLUDES
20 stm32f4xx_flash_ramfunc.c
32 set(STM32F4_STDPERIPH_SRC_DIR "${STM32F4_STDPERIPH_DIR}/src")
33 glob_except(STM32F4_STDPERIPH_SRC "${STM32F4_STDPERIPH_SRC_DIR}/*.c" "${STM32F4_STDPERIPH_SRC_EXCLUDES}")
35 main_sources(STM32F4_SRC
36 target/system_stm32f4xx.c
38 config/config_streamer_stm32f4.c
40 drivers/adc_stm32f4xx.c
41 drivers/adc_stm32f4xx.c
42 drivers/bus_i2c_stm32f40x.c
43 drivers/serial_uart_stm32f4xx.c
44 drivers/system_stm32f4xx.c
46 drivers/timer_impl_stdperiph.c
47 drivers/timer_stm32f4xx.c
48 drivers/uart_inverter.c
49 drivers/dma_stm32f4xx.c
50 drivers/sdcard/sdmmc_sdio_f4xx.c
60 list(TRANSFORM STM32F4_VCP_SRC PREPEND "${STM32F4_VCP_DIR}/")
62 main_sources(STM32F4_MSC_SRC
63 drivers/usb_msc_f4xx.c
66 set(STM32F4_INCLUDE_DIRS
67 "${CMSIS_INCLUDE_DIR}"
68 "${CMSIS_DSP_INCLUDE_DIR}"
69 "${STM32F4_STDPERIPH_DIR}/inc"
70 "${STM32F4_CMSIS_DEVICE_DIR}"
71 "${STM32F4_CMSIS_DRIVERS_DIR}"
75 set(STM32F4_DEFINITIONS
76 ${CORTEX_M4F_DEFINITIONS}
81 function(target_stm32f4xx)
83 SOURCES ${STM32_STDPERIPH_SRC} ${STM32F4_SRC}
84 COMPILE_DEFINITIONS ${STM32F4_DEFINITIONS}
85 COMPILE_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS}
86 INCLUDE_DIRECTORIES ${STM32F4_INCLUDE_DIRS}
87 LINK_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS}
89 MSC_SOURCES ${STM32F4_USBMSC_SRC} ${STM32F4_MSC_SRC}
90 VCP_SOURCES ${STM32F4_USB_SRC} ${STM32F4_VCP_SRC}
91 VCP_INCLUDE_DIRECTORIES ${STM32F4_USB_INCLUDE_DIRS}
95 OPENOCD_TARGET stm32f4x
101 set(STM32F405_COMPILE_DEFINITIONS
107 function(target_stm32f405xg name)
110 STARTUP startup_stm32f40xx.s
111 SOURCES ${STM32F4_STDPERIPH_SRC}
112 COMPILE_DEFINITIONS ${STM32F405_COMPILE_DEFINITIONS}
113 LINKER_SCRIPT stm32_flash_f405xg
120 set(STM32F411_OR_F427_STDPERIPH_SRC ${STM32F4_STDPERIPH_SRC})
121 set(STM32F411_OR_F427_STDPERIPH_SRC_EXCLUDES "stm32f4xx_fsmc.c")
122 exclude_basenames(STM32F411_OR_F427_STDPERIPH_SRC ${STM32F411_OR_F427_STDPERIPH_SRC_EXCLUDES})
124 set(STM32F411_COMPILE_DEFINITIONS
129 function(target_stm32f411xe name)
132 STARTUP startup_stm32f411xe.s
133 SOURCES ${STM32F411_OR_F427_STDPERIPH_SRC}
134 COMPILE_DEFINITIONS ${STM32F411_COMPILE_DEFINITIONS}
135 LINKER_SCRIPT stm32_flash_f411xe
141 set(STM32F427_COMPILE_DEFINITIONS
145 function(target_stm32f427xg name)
148 STARTUP startup_stm32f427xx.s
149 SOURCES ${STM32F411_OR_F427_STDPERIPH_SRC}
150 COMPILE_DEFINITIONS ${STM32F427_COMPILE_DEFINITIONS}
151 LINKER_SCRIPT stm32_flash_f427xg