4 set(STM32H7_CMSIS_DEVICE_DIR "${MAIN_LIB_DIR}/main/STM32H7/Drivers/CMSIS/Device/ST/STM32H7xx")
5 set(STM32H7_HAL_DIR "${MAIN_LIB_DIR}/main/STM32H7/Drivers/STM32H7xx_HAL_Driver")
10 stm32h7xx_hal_adc_ex.c
12 # stm32h7xx_hal_comp.c
13 stm32h7xx_hal_cortex.c
15 # stm32h7xx_hal_crc_ex.c
16 # stm32h7xx_hal_cryp.c
17 # stm32h7xx_hal_cryp_ex.c
19 stm32h7xx_hal_dac_ex.c
20 # stm32h7xx_hal_dcmi.c
21 # stm32h7xx_hal_dfsdm.c
22 # stm32h7xx_hal_dfsdm_ex.c
24 # stm32h7xx_hal_dma2d.c
25 stm32h7xx_hal_dma_ex.c
29 # stm32h7xx_hal_eth_ex.c
31 # stm32h7xx_hal_fdcan.c
33 stm32h7xx_hal_flash_ex.c
34 stm32h7xx_hal_gfxmmu.c
36 # stm32h7xx_hal_hash.c
37 # stm32h7xx_hal_hash_ex.c
39 # stm32h7xx_hal_hrtim.c
40 # stm32h7xx_hal_hsem.c
42 stm32h7xx_hal_i2c_ex.c
44 # stm32h7xx_hal_i2s_ex.c
45 # stm32h7xx_hal_irda.c
46 # stm32h7xx_hal_iwdg.c
47 # stm32h7xx_hal_jpeg.c
48 # stm32h7xx_hal_lptim.c
49 # stm32h7xx_hal_ltdc.c
50 # stm32h7xx_hal_ltdc_ex.c
51 # stm32h7xx_hal_mdios.c
52 # stm32h7xx_hal_mdma.c
54 # stm32h7xx_hal_mmc_ex.c
55 # stm32h7xx_hal_nand.c
57 # stm32h7xx_hal_opamp.c
58 # stm32h7xx_hal_opamp_ex.c
60 stm32h7xx_hal_otfdec.c
62 stm32h7xx_hal_pcd_ex.c
65 stm32h7xx_hal_pwr_ex.c
67 # stm32h7xx_hal_ramecc.c
69 stm32h7xx_hal_rcc_ex.c
71 # stm32h7xx_hal_rng_ex.c
73 stm32h7xx_hal_rtc_ex.c
75 # stm32h7xx_hal_sai_ex.c
78 # stm32h7xx_hal_sdram.c
79 # stm32h7xx_hal_smartcard.c
80 # stm32h7xx_hal_smartcard_ex.c
81 # stm32h7xx_hal_smbus.c
82 # stm32h7xx_hal_spdifrx.c
84 stm32h7xx_hal_spi_ex.c
85 # stm32h7xx_hal_sram.c
86 # stm32h7xx_hal_swpmi.c
88 stm32h7xx_hal_tim_ex.c
90 stm32h7xx_hal_uart_ex.c
91 # stm32h7xx_hal_usart.c
92 # stm32h7xx_hal_usart_ex.c
93 # stm32h7xx_hal_wwdg.c
100 # stm32h7xx_ll_delayblock.c
102 # stm32h7xx_ll_dma2d.c
105 # stm32h7xx_ll_gpio.c
106 # stm32h7xx_ll_hrtim.c
108 # stm32h7xx_ll_lptim.c
109 # stm32h7xx_ll_lpuart.c
110 # stm32h7xx_ll_mdma.c
111 # stm32h7xx_ll_opamp.c
118 # stm32h7xx_ll_swpmi.c
120 # stm32h7xx_ll_usart.c
122 # stm32h7xx_ll_utils.c
125 list(TRANSFORM STM32H7_HAL_SRC PREPEND "${STM32H7_HAL_DIR}/Src/")
127 set(STM32H7_VCP_DIR "${MAIN_SRC_DIR}/vcp_hal")
131 usbd_conf_stm32h7xx.c
134 list(TRANSFORM STM32H7_VCP_SRC PREPEND "${STM32H7_VCP_DIR}/")
136 set(STM32H7_INCLUDE_DIRS
137 ${STM32H7_HAL_DIR}/Inc
138 ${STM32H7_CMSIS_DEVICE_DIR}/Include
141 main_sources(STM32H7_SRC
142 target/system_stm32h7xx.c
144 config/config_streamer_stm32h7.c
145 config/config_streamer_ram.c
146 config/config_streamer_extflash.c
148 drivers/adc_stm32h7xx.c
149 drivers/bus_i2c_hal.c
150 drivers/dma_stm32h7xx.c
151 drivers/bus_spi_hal_ll.c
152 drivers/bus_quadspi.c
153 drivers/bus_quadspi_hal.c
155 drivers/memprot_hal.c
156 drivers/memprot_stm32h7xx.c
158 drivers/timer_impl_hal.c
159 drivers/timer_stm32h7xx.c
160 drivers/system_stm32h7xx.c
161 drivers/serial_uart_stm32h7xx.c
162 drivers/serial_uart_hal.c
164 drivers/sdcard/sdmmc_sdio_h7xx.c
167 main_sources(STM32H7_MSC_SRC
168 drivers/usb_msc_h7xx.c
171 set(STM32H7_DEFINITIONS
172 ${CORTEX_M7_DEFINITIONS}
178 function(target_stm32h7xx)
180 SOURCES ${STM32H7_HAL_SRC} ${STM32H7_SRC}
181 COMPILE_DEFINITIONS ${STM32H7_DEFINITIONS}
182 COMPILE_OPTIONS ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_COMPILE_OPTIONS}
183 INCLUDE_DIRECTORIES ${STM32H7_INCLUDE_DIRS}
184 LINK_OPTIONS ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_LINK_OPTIONS}
186 MSC_SOURCES ${STM32H7_USBMSC_SRC} ${STM32H7_MSC_SRC}
187 VCP_SOURCES ${STM32H7_USB_SRC} ${STM32H7_VCP_SRC}
188 VCP_INCLUDE_DIRECTORIES ${STM32H7_USB_INCLUDE_DIRS} ${STM32H7_VCP_DIR}
192 OPENOCD_TARGET stm32h7x
200 macro(define_target_stm32h7 subfamily size)
201 function(target_stm32h7${subfamily}x${size} name)
203 string(TOUPPER ${size} upper_size)
204 get_stm32_flash_size(flash_size ${size})
207 STM32H7${subfamily}xx
208 STM32H7${subfamily}x${upper_size}
209 # stm32h743xx.h defined FLASH_SIZE, used by HAL, but in bytes
210 # use MCU_FLASH_SIZE since we use KiB in our code
211 MCU_FLASH_SIZE=${flash_size}
215 STARTUP startup_stm32h7${subfamily}xx.s
216 COMPILE_DEFINITIONS ${definitions}
217 LINKER_SCRIPT stm32_flash_h7${subfamily}x${size}
219 SVD STM32H7${subfamily}
224 define_target_stm32h7(43 i)