5 ifeq ($(DEBUG_HARDFAULTS
),H5
)
6 CFLAGS
+= -DDEBUG_HARDFAULTS
10 CMSIS_DIR
:= $(ROOT
)/lib
/main
/CMSIS
13 STDPERIPH_DIR
= $(ROOT
)/lib
/main
/STM32H5
/Drivers
/STM32H5xx_HAL_Driver
16 stm32h5xx_hal_adc_ex.c \
18 stm32h5xx_hal_cordic.c \
19 stm32h5xx_hal_cortex.c \
21 stm32h5xx_hal_dac_ex.c \
22 stm32h5xx_hal_dcache.c \
24 stm32h5xx_hal_dma_ex.c \
26 stm32h5xx_hal_exti.c \
27 stm32h5xx_hal_flash.c \
28 stm32h5xx_hal_flash_ex.c \
29 stm32h5xx_hal_fmac.c \
30 stm32h5xx_hal_gpio.c \
31 stm32h5xx_hal_gtzc.c \
33 stm32h5xx_hal_i2c_ex.c \
35 stm32h5xx_hal_icache.c \
36 stm32h5xx_hal_otfdec.c \
38 stm32h5xx_hal_pcd_ex.c \
40 stm32h5xx_hal_pssi.c \
42 stm32h5xx_hal_pwr_ex.c \
43 stm32h5xx_hal_ramcfg.c \
45 stm32h5xx_hal_rcc_ex.c \
46 stm32h5xx_hal_rng_ex.c \
47 stm32h5xx_hal_rtc_ex.c \
49 stm32h5xx_hal_smbus_ex.c \
50 stm32h5xx_hal_spi_ex.c \
52 stm32h5xx_hal_tim_ex.c \
53 stm32h5xx_hal_uart.c \
54 stm32h5xx_hal_uart_ex.c \
55 stm32h5xx_hal_xspi.c \
56 stm32h5xx_ll_cordic.c \
62 stm32h5xx_ll_icache.c \
64 stm32h5xx_ll_sdmmc.c \
71 #USB ##TODO - need to work through the USB drivers, new directory: USBX
72 #USBCORE_DIR = $(ROOT)/lib/main/STM32H5/Middlewares/ST/usbx/Common
73 #USBCORE_SRC = $(notdir $(wildcard $(USBCORE_DIR)/Src/*.c))
75 #USBCORE_SRC := $(filter-out ${EXCLUDES}, $(USBCORE_SRC))
77 #VPATH := $(VPATH):$(USBCDC_DIR)/Src:$(USBCORE_DIR)/Src:$(USBHID_DIR)/Src:$(USBMSC_DIR)/Src:$(STDPERIPH_DIR)/src
79 DEVICE_STDPERIPH_SRC
:= $(STDPERIPH_SRC
) \
86 VPATH
:= $(VPATH
):$(CMSIS_DIR
)/Include
:$(CMSIS_DIR
)/Device
/ST
/STM32H5xx
87 VPATH
:= $(VPATH
):$(STDPERIPH_DIR
)/Src
89 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
90 $(SRC_DIR
)/startup
/stm32 \
91 $(STDPERIPH_DIR
)/Inc \
96 $(CMSIS_DIR
)/Core
/Include \
97 $(ROOT
)/lib
/main
/STM32H5
/Drivers
/CMSIS
/Device
/ST
/STM32H5xx
/Include \
98 $(SRC_DIR
)/drivers
/mcu
/stm32 \
99 $(SRC_DIR
)/drivers
/mcu
/stm32
/vcp_hal
102 ARCH_FLAGS
= -mthumb
-mcpu
=cortex-m7
-mfloat-abi
=hard
-mfpu
=fpv5-sp-d16
-fsingle-precision-constant
104 # Flags that are used in the STM32 libraries
105 DEVICE_FLAGS
= -DUSE_HAL_DRIVER
-DUSE_FULL_LL_DRIVER
108 # H563xx : 2M FLASH, 640KB SRAM
110 ifeq ($(TARGET_MCU
),STM32H563xx
)
111 DEVICE_FLAGS
+= -DSTM32H563xx
112 DEFAULT_LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_h563_2m.
ld
113 STARTUP_SRC
= stm32
/startup_stm32h563xx.s
114 MCU_FLASH_SIZE
:= 2048
115 DEVICE_FLAGS
+= -DMAX_MPU_REGIONS
=16
121 OPTIMISE_DEFAULT
:= -Os
122 OPTIMISE_SPEED
:= -Os
125 LTO_FLAGS
:= $(OPTIMISATION_BASE
) $(OPTIMISE_DEFAULT
)
129 $(error Unknown MCU for STM32H5 target
)
133 LD_SCRIPT
= $(DEFAULT_LD_SCRIPT
)
136 ifneq ($(FIRMWARE_SIZE
),)
137 DEVICE_FLAGS
+= -DFIRMWARE_SIZE
=$(FIRMWARE_SIZE
)
140 DEVICE_FLAGS
+= -DHSE_VALUE
=$(HSE_VALUE
) -DHSE_STARTUP_TIMEOUT
=1000 -DSTM32
144 drivers
/mcu
/stm32
/vcp_hal
/usbd_desc.c \
145 drivers
/mcu
/stm32
/vcp_hal
/usbd_conf_stm32h5xx.c \
146 drivers
/mcu
/stm32
/vcp_hal
/usbd_cdc_hid.c \
147 drivers
/mcu
/stm32
/vcp_hal
/usbd_cdc_interface.c \
148 drivers
/mcu
/stm32
/serial_usb_vcp.c \
152 drivers
/bus_i2c_timing.c \
153 drivers
/bus_quadspi.c \
154 drivers
/dshot_bitbang_decode.c \
155 drivers
/pwm_output_dshot_shared.c \
156 drivers
/mcu
/stm32
/bus_i2c_hal_init.c \
157 drivers
/mcu
/stm32
/bus_i2c_hal.c \
158 drivers
/mcu
/stm32
/bus_spi_ll.c \
159 drivers
/mcu
/stm32
/bus_quadspi_hal.c \
160 drivers
/mcu
/stm32
/debug.c \
161 drivers
/mcu
/stm32
/dma_reqmap_mcu.c \
162 drivers
/mcu
/stm32
/dshot_bitbang_ll.c \
163 drivers
/mcu
/stm32
/dshot_bitbang.c \
164 drivers
/mcu
/stm32
/exti.c \
165 drivers
/mcu
/stm32
/io_stm32.c \
166 drivers
/mcu
/stm32
/light_ws2811strip_hal.c \
167 drivers
/mcu
/stm32
/persistent.c \
168 drivers
/mcu
/stm32
/pwm_output.c \
169 drivers
/mcu
/stm32
/pwm_output_dshot_hal.c \
170 drivers
/mcu
/stm32
/rcc_stm32.c \
171 drivers
/mcu
/stm32
/serial_uart_hal.c \
172 drivers
/mcu
/stm32
/timer_hal.c \
173 drivers
/mcu
/stm32
/transponder_ir_io_hal.c \
174 drivers
/mcu
/stm32
/camera_control.c \
175 drivers
/mcu
/stm32
/system_stm32h5xx.c \
176 startup
/stm32
/system_stm32h5xx.c
178 # drivers/mcu/stm32/memprot_hal.c \
179 # drivers/mcu/stm32/memprot_stm32h5xx.c \
180 # drivers/mcu/stm32/serial_uart_stm32h5xx.c \
181 # drivers/mcu/stm32/sdio_h5xx.c \
182 # drivers/mcu/stm32/timer_stm32h5xx.c \
183 # drivers/mcu/stm32/adc_stm32h5xx.c \
184 # drivers/mcu/stm32/dma_stm32h5xx.c \
191 drivers
/mcu
/stm32
/usb_msc_hal.c \
192 drivers
/usb_msc_common.c \
194 msc
/usbd_storage_emfat.c \
197 msc
/usbd_storage_sd_spi.c \
198 msc
/usbd_storage_sdio.c
200 DSP_LIB
:= $(ROOT
)/lib
/main
/CMSIS
/DSP
201 DEVICE_FLAGS
+= -DARM_MATH_MATRIX_CHECK
-DARM_MATH_ROUNDING
-DUNALIGNED_SUPPORT_DISABLE
-DARM_MATH_CM7