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
39 config/config_streamer_ram.c
40 config/config_streamer_extflash.c
42 drivers/adc_stm32f4xx.c
43 drivers/adc_stm32f4xx.c
44 drivers/bus_i2c_stm32f40x.c
45 drivers/serial_uart_stm32f4xx.c
46 drivers/system_stm32f4xx.c
48 drivers/timer_impl_stdperiph.c
49 drivers/timer_stm32f4xx.c
50 drivers/uart_inverter.c
51 drivers/dma_stm32f4xx.c
52 drivers/sdcard/sdmmc_sdio_f4xx.c
62 list(TRANSFORM STM32F4_VCP_SRC PREPEND "${STM32F4_VCP_DIR}/")
64 main_sources(STM32F4_MSC_SRC
65 drivers/usb_msc_f4xx.c
68 set(STM32F4_INCLUDE_DIRS
69 "${CMSIS_INCLUDE_DIR}"
70 "${CMSIS_DSP_INCLUDE_DIR}"
71 "${STM32F4_STDPERIPH_DIR}/inc"
72 "${STM32F4_CMSIS_DEVICE_DIR}"
73 "${STM32F4_CMSIS_DRIVERS_DIR}"
77 set(STM32F4_DEFINITIONS
78 ${CORTEX_M4F_DEFINITIONS}
83 function(target_stm32f4xx)
85 SOURCES ${STM32_STDPERIPH_SRC} ${STM32F4_SRC}
86 COMPILE_DEFINITIONS ${STM32F4_DEFINITIONS}
87 COMPILE_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS}
88 INCLUDE_DIRECTORIES ${STM32F4_INCLUDE_DIRS}
89 LINK_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS}
91 MSC_SOURCES ${STM32F4_USBMSC_SRC} ${STM32F4_MSC_SRC}
92 VCP_SOURCES ${STM32F4_USB_SRC} ${STM32F4_VCP_SRC}
93 VCP_INCLUDE_DIRECTORIES ${STM32F4_USB_INCLUDE_DIRS}
97 OPENOCD_TARGET stm32f4x
103 set(STM32F405_COMPILE_DEFINITIONS
109 function(target_stm32f405xg name)
112 STARTUP startup_stm32f40xx.s
113 SOURCES ${STM32F4_STDPERIPH_SRC}
114 COMPILE_DEFINITIONS ${STM32F405_COMPILE_DEFINITIONS}
115 LINKER_SCRIPT stm32_flash_f405xg
122 set(STM32F411_OR_F427_STDPERIPH_SRC ${STM32F4_STDPERIPH_SRC})
123 set(STM32F411_OR_F427_STDPERIPH_SRC_EXCLUDES "stm32f4xx_fsmc.c")
124 exclude_basenames(STM32F411_OR_F427_STDPERIPH_SRC ${STM32F411_OR_F427_STDPERIPH_SRC_EXCLUDES})
126 set(STM32F411_COMPILE_DEFINITIONS
132 function(target_stm32f411xe name)
135 STARTUP startup_stm32f411xe.s
136 SOURCES ${STM32F411_OR_F427_STDPERIPH_SRC}
137 COMPILE_DEFINITIONS ${STM32F411_COMPILE_DEFINITIONS}
138 LINKER_SCRIPT stm32_flash_f411xe
144 set(STM32F427_COMPILE_DEFINITIONS
148 function(target_stm32f427xg name)
151 STARTUP startup_stm32f427xx.s
152 SOURCES ${STM32F411_OR_F427_STDPERIPH_SRC}
153 COMPILE_DEFINITIONS ${STM32F427_COMPILE_DEFINITIONS}
154 LINKER_SCRIPT stm32_flash_f427xg