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 VPATH
:= $(VPATH
):$(STDPERIPH_DIR
)/Src
15 CMSIS_DIR
:= $(ROOT
)/lib
/main
/CMSIS
16 STDPERIPH_DIR
= $(ROOT
)/lib
/main
/STM32F4
/Drivers
/STM32F4xx_StdPeriph_Driver
17 STDPERIPH_SRC
= $(notdir $(wildcard $(STDPERIPH_DIR
)/src
/*.c
))
18 EXCLUDES
= stm32f4xx_crc.c \
24 stm32f4xx_flash_ramfunc.c \
30 stm32f4xx_cryp_aes.c \
31 stm32f4xx_hash_md5.c \
32 stm32f4xx_cryp_des.c \
35 stm32f4xx_cryp_tdes.c \
38 VPATH
:= $(VPATH
):$(STDPERIPH_DIR
)/src
41 ifeq ($(TARGET_MCU
),$(filter $(TARGET_MCU
),STM32F411xE STM32F446xx
))
42 EXCLUDES
+= stm32f4xx_fsmc.c
45 STDPERIPH_SRC
:= $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC
))
47 ifeq ($(PERIPH_DRIVER
), HAL
)
49 USBCORE_DIR
= $(ROOT
)/lib
/main
/STM32F4
/Middlewares
/ST
/STM32_USB_Device_Library
/Core
50 USBCORE_SRC
= $(notdir $(wildcard $(USBCORE_DIR
)/Src
/*.c
))
51 EXCLUDES
= usbd_conf_template.c
52 USBCORE_SRC
:= $(filter-out ${EXCLUDES}, $(USBCORE_SRC
))
54 USBCDC_DIR
= $(ROOT
)/lib
/main
/STM32F4
/Middlewares
/ST
/STM32_USB_Device_Library
/Class
/CDC
55 USBCDC_SRC
= $(notdir $(wildcard $(USBCDC_DIR
)/Src
/*.c
))
56 EXCLUDES
= usbd_cdc_if_template.c
57 USBCDC_SRC
:= $(filter-out ${EXCLUDES}, $(USBCDC_SRC
))
59 VPATH
:= $(VPATH
):$(USBCDC_DIR
)/Src
:$(USBCORE_DIR
)/Src
61 DEVICE_STDPERIPH_SRC
:= $(STDPERIPH_SRC
) \
65 USBCORE_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Core
66 USBCORE_SRC
= $(notdir $(wildcard $(USBCORE_DIR
)/src
/*.c
))
67 USBOTG_DIR
= $(ROOT
)/lib
/main
/STM32_USB_OTG_Driver
68 USBOTG_SRC
= $(notdir $(wildcard $(USBOTG_DIR
)/src
/*.c
))
69 EXCLUDES
= usb_bsp_template.c \
75 USBOTG_SRC
:= $(filter-out ${EXCLUDES}, $(USBOTG_SRC
))
76 USBCDC_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Class
/cdc
77 USBCDC_SRC
= $(notdir $(wildcard $(USBCDC_DIR
)/src
/*.c
))
78 EXCLUDES
= usbd_cdc_if_template.c
79 USBCDC_SRC
:= $(filter-out ${EXCLUDES}, $(USBCDC_SRC
))
80 USBMSC_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Class
/msc
81 USBMSC_SRC
= $(notdir $(wildcard $(USBMSC_DIR
)/src
/*.c
))
82 EXCLUDES
= usbd_storage_template.c
83 USBMSC_SRC
:= $(filter-out ${EXCLUDES}, $(USBMSC_SRC
))
84 USBHID_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Class
/hid
85 USBHID_SRC
= $(notdir $(wildcard $(USBHID_DIR
)/src
/*.c
))
86 USBWRAPPER_DIR
= $(ROOT
)/lib
/main
/STM32_USB_Device_Library
/Class
/hid_cdc_wrapper
87 USBWRAPPER_SRC
= $(notdir $(wildcard $(USBWRAPPER_DIR
)/src
/*.c
))
88 VPATH
:= $(VPATH
):$(USBOTG_DIR
)/src
:$(USBCORE_DIR
)/src
:$(USBCDC_DIR
)/src
:$(USBMSC_DIR
)/src
:$(USBHID_DIR
)/src
:$(USBWRAPPER_DIR
)/src
90 DEVICE_STDPERIPH_SRC
:= $(STDPERIPH_SRC
) \
100 VPATH
:= $(VPATH
):$(CMSIS_DIR
)/Core
/Include
:$(ROOT
)/lib
/main
/STM32F4
/Drivers
/CMSIS
/Device
/ST
/STM32F4xx
102 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
103 $(ROOT
)/src
/main
/drivers
/stm32
105 ifeq ($(PERIPH_DRIVER
), HAL
)
107 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
108 $(STDPERIPH_DIR
)/Inc \
111 $(CMSIS_DIR
)/Include \
112 $(CMSIS_DIR
)/Device
/ST
/STM32F4xx
/Include \
113 $(ROOT
)/src
/main
/drivers
/stm32
/vcp_hal
115 CMSIS_SRC
:= $(notdir $(wildcard $(CMSIS_DIR
)/CoreSupport
/*.c \
116 $(ROOT
)/lib
/main
/STM32F4
/Drivers
/CMSIS
/Device
/ST
/STM32F4xx
/*.c
))
117 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
118 $(STDPERIPH_DIR
)/inc \
123 $(USBWRAPPER_DIR
)/inc \
125 $(CMSIS_DIR
)/Core
/Include \
126 $(ROOT
)/lib
/main
/STM32F4
/Drivers
/CMSIS
/Device
/ST
/STM32F4xx \
127 $(ROOT
)/src
/main
/drivers
/stm32
/vcpf4
131 ARCH_FLAGS
= -mthumb
-mcpu
=cortex-m4
-march
=armv7e-m
-mfloat-abi
=hard
-mfpu
=fpv4-sp-d16
-fsingle-precision-constant
133 ifeq ($(TARGET_MCU
),STM32F411xE
)
134 DEVICE_FLAGS
= -DSTM32F411xE
-finline-limit
=20
135 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f411.
ld
136 STARTUP_SRC
= startup_stm32f411xe.s
137 MCU_FLASH_SIZE
:= 512
139 else ifeq ($(TARGET_MCU
),STM32F405xx
)
140 DEVICE_FLAGS
= -DSTM32F40_41xxx
-DSTM32F405xx
141 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f405.
ld
142 STARTUP_SRC
= startup_stm32f40xx.s
143 MCU_FLASH_SIZE
:= 1024
145 else ifeq ($(TARGET_MCU
),STM32F446xx
)
146 DEVICE_FLAGS
= -DSTM32F446xx
147 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f446.
ld
148 STARTUP_SRC
= startup_stm32f446xx.s
149 MCU_FLASH_SIZE
:= 512
152 $(error Unknown MCU for F4 target
)
154 DEVICE_FLAGS
+= -DHSE_VALUE
=$(HSE_VALUE
) -DSTM32
157 drivers
/accgyro
/accgyro_mpu.c \
158 drivers
/dshot_bitbang_decode.c \
160 drivers
/pwm_output_dshot_shared.c \
161 drivers
/stm32
/pwm_output_dshot.c \
162 drivers
/stm32
/adc_stm32f4xx.c \
163 drivers
/stm32
/bus_i2c_stm32f4xx.c \
164 drivers
/stm32
/bus_spi_stdperiph.c \
165 drivers
/stm32
/debug.c \
166 drivers
/stm32
/dma_reqmap_mcu.c \
167 drivers
/stm32
/dma_stm32f4xx.c \
168 drivers
/stm32
/dshot_bitbang.c \
169 drivers
/stm32
/dshot_bitbang_stdperiph.c \
170 drivers
/stm32
/exti.c \
171 drivers
/stm32
/io_stm32.c \
172 drivers
/stm32
/light_ws2811strip_stdperiph.c \
173 drivers
/stm32
/persistent.c \
174 drivers
/stm32
/pwm_output.c \
175 drivers
/stm32
/rcc_stm32.c \
176 drivers
/stm32
/sdio_f4xx.c \
177 drivers
/stm32
/serial_uart_stdperiph.c \
178 drivers
/stm32
/serial_uart_stm32f4xx.c \
179 drivers
/stm32
/system_stm32f4xx.c \
180 drivers
/stm32
/timer_stdperiph.c \
181 drivers
/stm32
/timer_stm32f4xx.c \
182 drivers
/stm32
/transponder_ir_io_stdperiph.c \
183 drivers
/stm32
/usbd_msc_desc.c \
184 startup
/system_stm32f4xx.c
186 ifeq ($(PERIPH_DRIVER
), HAL
)
188 drivers
/stm32
/vcp_hal
/usbd_desc.c \
189 drivers
/stm32
/vcp_hal
/usbd_conf.c \
190 drivers
/stm32
/vcp_hal
/usbd_cdc_interface.c \
191 drivers
/stm32
/serial_usb_vcp.c \
195 drivers
/stm32
/vcpf4
/stm32f4xx_it.c \
196 drivers
/stm32
/vcpf4
/usb_bsp.c \
197 drivers
/stm32
/vcpf4
/usbd_desc.c \
198 drivers
/stm32
/vcpf4
/usbd_usr.c \
199 drivers
/stm32
/vcpf4
/usbd_cdc_vcp.c \
200 drivers
/stm32
/vcpf4
/usb_cdc_hid.c \
201 drivers
/stm32
/serial_usb_vcp.c \
206 drivers
/usb_msc_common.c \
207 drivers
/stm32
/usb_msc_f4xx.c \
209 msc
/usbd_storage_emfat.c \
212 msc
/usbd_storage_sd_spi.c \
213 msc
/usbd_storage_sdio.c
215 DSP_LIB
:= $(ROOT
)/lib
/main
/CMSIS
/DSP
216 DEVICE_FLAGS
+= -DARM_MATH_MATRIX_CHECK
-DARM_MATH_ROUNDING
-D__FPU_PRESENT
=1 -DUNALIGNED_SUPPORT_DISABLE
-DARM_MATH_CM4