5 ifeq ($(DEBUG_HARDFAULTS
),F7
)
6 CFLAGS
+= -DDEBUG_HARDFAULTS
10 CMSIS_DIR
:= $(ROOT
)/lib
/main
/CMSIS
13 STDPERIPH_DIR
= $(ROOT
)/lib
/main
/STM32F7
/Drivers
/STM32F7xx_HAL_Driver
14 STDPERIPH_SRC
= $(notdir $(wildcard $(STDPERIPH_DIR
)/Src
/*.c
))
15 EXCLUDES
= stm32f7xx_hal_can.c \
18 stm32f7xx_hal_crc_ex.c \
19 stm32f7xx_hal_cryp.c \
20 stm32f7xx_hal_cryp_ex.c \
21 stm32f7xx_hal_dcmi.c \
22 stm32f7xx_hal_dcmi_ex.c \
23 stm32f7xx_hal_dfsdm.c \
24 stm32f7xx_hal_dma2d.c \
27 stm32f7xx_hal_hash.c \
28 stm32f7xx_hal_hash_ex.c \
31 stm32f7xx_hal_irda.c \
32 stm32f7xx_hal_iwdg.c \
33 stm32f7xx_hal_jpeg.c \
34 stm32f7xx_hal_lptim.c \
35 stm32f7xx_hal_ltdc.c \
36 stm32f7xx_hal_ltdc_ex.c \
37 stm32f7xx_hal_mdios.c \
39 stm32f7xx_hal_msp_template.c \
40 stm32f7xx_hal_nand.c \
42 stm32f7xx_hal_qspi.c \
45 stm32f7xx_hal_sai_ex.c \
47 stm32f7xx_hal_sdram.c \
48 stm32f7xx_hal_smartcard.c \
49 stm32f7xx_hal_smartcard_ex.c \
50 stm32f7xx_hal_smbus.c \
51 stm32f7xx_hal_spdifrx.c \
52 stm32f7xx_hal_sram.c \
53 stm32f7xx_hal_timebase_rtc_alarm_template.c \
54 stm32f7xx_hal_timebase_rtc_wakeup_template.c \
55 stm32f7xx_hal_timebase_tim_template.c \
56 stm32f7xx_hal_wwdg.c \
63 stm32f7xx_ll_lptim.c \
67 stm32f7xx_ll_sdmmc.c \
70 STDPERIPH_SRC
:= $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC
))
73 USBCORE_DIR
= $(ROOT
)/lib
/main
/STM32F7
/Middlewares
/ST
/STM32_USB_Device_Library
/Core
74 USBCORE_SRC
= $(notdir $(wildcard $(USBCORE_DIR
)/Src
/*.c
))
75 EXCLUDES
= usbd_conf_template.c
76 USBCORE_SRC
:= $(filter-out ${EXCLUDES}, $(USBCORE_SRC
))
78 USBCDC_DIR
= $(ROOT
)/lib
/main
/STM32F7
/Middlewares
/ST
/STM32_USB_Device_Library
/Class
/CDC
79 USBCDC_SRC
= $(notdir $(wildcard $(USBCDC_DIR
)/Src
/*.c
))
80 EXCLUDES
= usbd_cdc_if_template.c
81 USBCDC_SRC
:= $(filter-out ${EXCLUDES}, $(USBCDC_SRC
))
83 USBHID_DIR
= $(ROOT
)/lib
/main
/STM32F7
/Middlewares
/ST
/STM32_USB_Device_Library
/Class
/HID
84 USBHID_SRC
= $(notdir $(wildcard $(USBHID_DIR
)/Src
/*.c
))
86 USBMSC_DIR
= $(ROOT
)/lib
/main
/STM32F7
/Middlewares
/ST
/STM32_USB_Device_Library
/Class
/MSC
87 USBMSC_SRC
= $(notdir $(wildcard $(USBMSC_DIR
)/Src
/*.c
))
88 EXCLUDES
= usbd_msc_storage_template.c
89 USBMSC_SRC
:= $(filter-out ${EXCLUDES}, $(USBMSC_SRC
))
91 VPATH
:= $(VPATH
):$(USBCDC_DIR
)/Src
:$(USBCORE_DIR
)/Src
:$(USBHID_DIR
)/Src
:$(USBMSC_DIR
)/Src
93 DEVICE_STDPERIPH_SRC
:= $(STDPERIPH_SRC
) \
100 VPATH
:= $(VPATH
):$(CMSIS_DIR
)/Include
:$(CMSIS_DIR
)/Device
/ST
/STM32F7xx
101 VPATH
:= $(VPATH
):$(STDPERIPH_DIR
)/Src
103 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
104 $(STDPERIPH_DIR
)/Inc \
109 $(CMSIS_DIR
)/Core
/Include \
110 $(ROOT
)/lib
/main
/STM32F7
/Drivers
/CMSIS
/Device
/ST
/STM32F7xx
/Include \
111 $(ROOT
)/src
/main
/vcp_hal
113 ifneq ($(filter SDCARD_SPI
,$(FEATURES
)),)
114 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
116 VPATH
:= $(VPATH
):$(FATFS_DIR
)
119 ifneq ($(filter SDCARD_SDIO
,$(FEATURES
)),)
120 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
122 VPATH
:= $(VPATH
):$(FATFS_DIR
)
126 ARCH_FLAGS
= -mthumb
-mcpu
=cortex-m7
-mfloat-abi
=hard
-mfpu
=fpv5-sp-d16
-fsingle-precision-constant
128 # Flags that are used in the STM32 libraries
129 DEVICE_FLAGS
= -DUSE_HAL_DRIVER
-DUSE_FULL_LL_DRIVER
131 ifeq ($(TARGET
),$(filter $(TARGET
),$(F7X5XI_TARGETS
)))
132 DEVICE_FLAGS
+= -DSTM32F765xx
133 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f765.
ld
134 STARTUP_SRC
= startup_stm32f765xx.s
135 MCU_FLASH_SIZE
:= 2048
136 else ifeq ($(TARGET
),$(filter $(TARGET
),$(F7X5XG_TARGETS
)))
137 DEVICE_FLAGS
+= -DSTM32F745xx
138 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f74x.
ld
139 STARTUP_SRC
= startup_stm32f745xx.s
140 MCU_FLASH_SIZE
:= 1024
141 else ifeq ($(TARGET
),$(filter $(TARGET
),$(F7X6XG_TARGETS
)))
142 DEVICE_FLAGS
+= -DSTM32F746xx
143 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f74x.
ld
144 STARTUP_SRC
= startup_stm32f746xx.s
145 MCU_FLASH_SIZE
:= 1024
146 else ifeq ($(TARGET
),$(filter $(TARGET
),$(F7X2RE_TARGETS
)))
147 DEVICE_FLAGS
+= -DSTM32F722xx
149 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f722.
ld
151 STARTUP_SRC
= startup_stm32f722xx.s
152 MCU_FLASH_SIZE
:= 512
153 # Override the OPTIMISE_SPEED compiler setting to save flash space on these 512KB targets.
154 # Performance is only slightly affected but around 50 kB of flash are saved.
157 $(error Unknown MCU for F7 target
)
159 DEVICE_FLAGS
+= -DHSE_VALUE
=$(HSE_VALUE
)
161 TARGET_FLAGS
= -D
$(TARGET
)
164 vcp_hal
/usbd_desc.c \
165 vcp_hal
/usbd_conf_stm32f7xx.c \
166 vcp_hal
/usbd_cdc_hid.c \
167 vcp_hal
/usbd_cdc_interface.c \
168 drivers
/serial_usb_vcp.c \
172 startup
/system_stm32f7xx.c \
173 drivers
/accgyro
/accgyro_mpu.c \
174 drivers
/adc_stm32f7xx.c \
175 drivers
/audio_stm32f7xx.c \
176 drivers
/bus_i2c_hal.c \
177 drivers
/bus_i2c_hal_init.c \
178 drivers
/bus_i2c_timing.c \
179 drivers
/dma_stm32f7xx.c \
180 drivers
/light_ws2811strip_hal.c \
181 drivers
/transponder_ir_io_hal.c \
182 drivers
/bus_spi_ll.c \
183 drivers
/persistent.c \
184 drivers
/dshot_bitbang.c \
185 drivers
/dshot_bitbang_decode.c \
186 drivers
/dshot_bitbang_ll.c \
187 drivers
/pwm_output_dshot_hal.c \
188 drivers
/pwm_output_dshot_shared.c \
189 drivers
/timer_hal.c \
190 drivers
/timer_stm32f7xx.c \
191 drivers
/system_stm32f7xx.c \
192 drivers
/serial_uart_hal.c \
193 drivers
/serial_uart_stm32f7xx.c
200 drivers
/usb_msc_common.c \
201 drivers
/usb_msc_f7xx.c \
204 ifneq ($(filter SDCARD_SDIO
,$(FEATURES
)),)
208 msc
/usbd_storage_sdio.c
211 ifneq ($(filter SDCARD_SPI
,$(FEATURES
)),)
213 msc
/usbd_storage_sd_spi.c
216 ifneq ($(filter ONBOARDFLASH
,$(FEATURES
)),)
218 msc
/usbd_storage_emfat.c \
223 DSP_LIB
:= $(ROOT
)/lib
/main
/CMSIS
/DSP
224 DEVICE_FLAGS
+= -DARM_MATH_MATRIX_CHECK
-DARM_MATH_ROUNDING
-D__FPU_PRESENT
=1 -DUNALIGNED_SUPPORT_DISABLE
-DARM_MATH_CM7