6 ifeq ($(PERIPH_DRIVER
), HAL
)
7 CMSIS_DIR
:= $(ROOT
)/lib
/main
/STM32F4
/Drivers
/CMSIS
8 STDPERIPH_DIR
= $(ROOT
)/lib
/main
/STM32F4
/Drivers
/STM32F4xx_HAL_Driver
9 STDPERIPH_SRC
= $(notdir $(wildcard $(STDPERIPH_DIR
)/Src
/*.c
))
12 CMSIS_DIR
:= $(ROOT
)/lib
/main
/CMSIS
13 STDPERIPH_DIR
= $(ROOT
)/lib
/main
/STM32F4
/Drivers
/STM32F4xx_StdPeriph_Driver
14 STDPERIPH_SRC
= $(notdir $(wildcard $(STDPERIPH_DIR
)/src
/*.c
))
15 EXCLUDES
= stm32f4xx_crc.c \
21 stm32f4xx_flash_ramfunc.c \
27 stm32f4xx_cryp_aes.c \
28 stm32f4xx_hash_md5.c \
29 stm32f4xx_cryp_des.c \
32 stm32f4xx_cryp_tdes.c \
36 ifeq ($(TARGET
),$(filter $(TARGET
), $(F411_TARGETS
)))
37 EXCLUDES
+= stm32f4xx_fsmc.c
39 else ifeq ($(TARGET
),$(filter $(TARGET
), $(F446_TARGETS
)))
40 EXCLUDES
+= stm32f4xx_fsmc.c
43 MCU_FLASH_SIZE
:= 1024
46 STDPERIPH_SRC
:= $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC
))
48 ifeq ($(PERIPH_DRIVER
), HAL
)
50 USBCORE_DIR
= $(ROOT
)/lib
/main
/STM32F4
/Middlewares
/ST
/STM32_USB_Device_Library
/Core
51 USBCORE_SRC
= $(notdir $(wildcard $(USBCORE_DIR
)/Src
/*.c
))
52 EXCLUDES
= usbd_conf_template.c
53 USBCORE_SRC
:= $(filter-out ${EXCLUDES}, $(USBCORE_SRC
))
55 USBCDC_DIR
= $(ROOT
)/lib
/main
/STM32F4
/Middlewares
/ST
/STM32_USB_Device_Library
/Class
/CDC
56 USBCDC_SRC
= $(notdir $(wildcard $(USBCDC_DIR
)/Src
/*.c
))
57 EXCLUDES
= usbd_cdc_if_template.c
58 USBCDC_SRC
:= $(filter-out ${EXCLUDES}, $(USBCDC_SRC
))
60 VPATH
:= $(VPATH
):$(USBCDC_DIR
)/Src
:$(USBCORE_DIR
)/Src
62 DEVICE_STDPERIPH_SRC
:= $(STDPERIPH_SRC
) \
66 USBCORE_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Core
67 USBCORE_SRC
= $(notdir $(wildcard $(USBCORE_DIR
)/src
/*.c
))
68 USBOTG_DIR
= $(ROOT
)/lib
/main
/STM32_USB_OTG_Driver
69 USBOTG_SRC
= $(notdir $(wildcard $(USBOTG_DIR
)/src
/*.c
))
70 EXCLUDES
= usb_bsp_template.c \
76 USBOTG_SRC
:= $(filter-out ${EXCLUDES}, $(USBOTG_SRC
))
77 USBCDC_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Class
/cdc
78 USBCDC_SRC
= $(notdir $(wildcard $(USBCDC_DIR
)/src
/*.c
))
79 EXCLUDES
= usbd_cdc_if_template.c
80 USBCDC_SRC
:= $(filter-out ${EXCLUDES}, $(USBCDC_SRC
))
81 USBMSC_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Class
/msc
82 USBMSC_SRC
= $(notdir $(wildcard $(USBMSC_DIR
)/src
/*.c
))
83 EXCLUDES
= usbd_storage_template.c
84 USBMSC_SRC
:= $(filter-out ${EXCLUDES}, $(USBMSC_SRC
))
85 USBHID_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Class
/hid
86 USBHID_SRC
= $(notdir $(wildcard $(USBHID_DIR
)/src
/*.c
))
87 USBWRAPPER_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Class
/hid_cdc_wrapper
88 USBWRAPPER_SRC
= $(notdir $(wildcard $(USBWRAPPER_DIR
)/src
/*.c
))
89 VPATH
:= $(VPATH
):$(USBOTG_DIR
)/src
:$(USBCORE_DIR
)/src
:$(USBCDC_DIR
)/src
:$(USBMSC_DIR
)/src
:$(USBHID_DIR
)/src
:$(USBWRAPPER_DIR
)/src
91 DEVICE_STDPERIPH_SRC
:= $(STDPERIPH_SRC
) \
101 VPATH
:= $(VPATH
):$(CMSIS_DIR
)/Core
/Include
:$(ROOT
)/lib
/main
/STM32F4
/Drivers
/CMSIS
/Device
/ST
/STM32F4xx
103 ifeq ($(PERIPH_DRIVER
), HAL
)
105 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
106 $(STDPERIPH_DIR
)/Inc \
109 $(CMSIS_DIR
)/Include \
110 $(CMSIS_DIR
)/Device
/ST
/STM32F4xx
/Include \
111 $(ROOT
)/src
/main
/vcp_hal
113 CMSIS_SRC
:= $(notdir $(wildcard $(CMSIS_DIR
)/CoreSupport
/*.c \
114 $(ROOT
)/lib
/main
/STM32F4
/Drivers
/CMSIS
/Device
/ST
/STM32F4xx
/*.c
))
115 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
116 $(STDPERIPH_DIR
)/inc \
121 $(USBWRAPPER_DIR
)/inc \
123 $(CMSIS_DIR
)/Core
/Include \
124 $(ROOT
)/lib
/main
/STM32F4
/Drivers
/CMSIS
/Device
/ST
/STM32F4xx \
125 $(ROOT
)/src
/main
/vcpf4
128 ifneq ($(filter SDCARD_SPI
,$(FEATURES
)),)
129 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
131 VPATH
:= $(VPATH
):$(FATFS_DIR
)
134 ifneq ($(filter SDCARD_SDIO
,$(FEATURES
)),)
135 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
137 VPATH
:= $(VPATH
):$(FATFS_DIR
)
141 ARCH_FLAGS
= -mthumb
-mcpu
=cortex-m4
-march
=armv7e-m
-mfloat-abi
=hard
-mfpu
=fpv4-sp-d16
-fsingle-precision-constant
143 ifeq ($(TARGET
),$(filter $(TARGET
),$(F411_TARGETS
)))
144 DEVICE_FLAGS
= -DSTM32F411xE
-finline-limit
=20
145 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f411.
ld
146 STARTUP_SRC
= startup_stm32f411xe.s
147 else ifeq ($(TARGET
),$(filter $(TARGET
),$(F405_TARGETS
)))
148 DEVICE_FLAGS
= -DSTM32F40_41xxx
-DSTM32F405xx
149 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f405.
ld
150 STARTUP_SRC
= startup_stm32f40xx.s
151 else ifeq ($(TARGET
),$(filter $(TARGET
),$(F446_TARGETS
)))
152 DEVICE_FLAGS
= -DSTM32F446xx
153 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f446.
ld
154 STARTUP_SRC
= startup_stm32f446xx.s
156 $(error Unknown MCU for F4 target
)
158 DEVICE_FLAGS
+= -DHSE_VALUE
=$(HSE_VALUE
)
161 startup
/system_stm32f4xx.c \
162 drivers
/accgyro
/accgyro_mpu.c \
163 drivers
/adc_stm32f4xx.c \
164 drivers
/bus_i2c_stm32f4xx.c \
165 drivers
/bus_spi_stdperiph.c \
166 drivers
/dma_stm32f4xx.c \
167 drivers
/dshot_bitbang.c \
168 drivers
/dshot_bitbang_decode.c \
169 drivers
/dshot_bitbang_stdperiph.c \
171 drivers
/light_ws2811strip_stdperiph.c \
172 drivers
/transponder_ir_io_stdperiph.c \
173 drivers
/pwm_output_dshot.c \
174 drivers
/pwm_output_dshot_shared.c \
175 drivers
/serial_uart_stdperiph.c \
176 drivers
/serial_uart_stm32f4xx.c \
177 drivers
/system_stm32f4xx.c \
178 drivers
/timer_stm32f4xx.c \
181 ifeq ($(PERIPH_DRIVER
), HAL
)
183 vcp_hal
/usbd_desc.c \
184 vcp_hal
/usbd_conf.c \
185 vcp_hal
/usbd_cdc_interface.c \
186 drivers
/serial_usb_vcp.c \
190 vcpf4
/stm32f4xx_it.c \
194 vcpf4
/usbd_cdc_vcp.c \
195 drivers
/serial_usb_vcp.c \
200 drivers
/usb_msc_common.c \
201 drivers
/usb_msc_f4xx.c \
202 msc
/usbd_msc_desc.c \
205 ifneq ($(filter SDCARD_SPI
,$(FEATURES
)),)
207 msc
/usbd_storage_sd_spi.c
210 ifneq ($(filter SDCARD_SDIO
,$(FEATURES
)),)
212 msc
/usbd_storage_sdio.c
217 ifneq ($(filter ONBOARDFLASH
,$(FEATURES
)),)
219 msc
/usbd_storage_emfat.c \
224 DSP_LIB
:= $(ROOT
)/lib
/main
/CMSIS
/DSP
225 DEVICE_FLAGS
+= -DARM_MATH_MATRIX_CHECK
-DARM_MATH_ROUNDING
-D__FPU_PRESENT
=1 -DUNALIGNED_SUPPORT_DISABLE
-DARM_MATH_CM4