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
153 drivers/memprot_hal.c
154 drivers/memprot_stm32h7xx.c
156 drivers/timer_impl_hal.c
157 drivers/timer_stm32h7xx.c
158 drivers/system_stm32h7xx.c
159 drivers/serial_uart_stm32h7xx.c
160 drivers/serial_uart_hal.c
162 drivers/sdcard/sdmmc_sdio_h7xx.c
165 main_sources(STM32H7_MSC_SRC
166 drivers/usb_msc_h7xx.c
169 set(STM32H7_DEFINITIONS
170 ${CORTEX_M7_DEFINITIONS}
176 function(target_stm32h7xx)
178 SOURCES ${STM32H7_HAL_SRC} ${STM32H7_SRC}
179 COMPILE_DEFINITIONS ${STM32H7_DEFINITIONS}
180 COMPILE_OPTIONS ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_COMPILE_OPTIONS}
181 INCLUDE_DIRECTORIES ${STM32H7_INCLUDE_DIRS}
182 LINK_OPTIONS ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_LINK_OPTIONS}
184 MSC_SOURCES ${STM32H7_USBMSC_SRC} ${STM32H7_MSC_SRC}
185 VCP_SOURCES ${STM32H7_USB_SRC} ${STM32H7_VCP_SRC}
186 VCP_INCLUDE_DIRECTORIES ${STM32H7_USB_INCLUDE_DIRS} ${STM32H7_VCP_DIR}
190 OPENOCD_TARGET stm32h7x
198 macro(define_target_stm32h7 subfamily size)
199 function(target_stm32h7${subfamily}x${size} name)
201 string(TOUPPER ${size} upper_size)
202 get_stm32_flash_size(flash_size ${size})
205 STM32H7${subfamily}xx
206 STM32H7${subfamily}x${upper_size}
207 # stm32h743xx.h defined FLASH_SIZE, used by HAL, but in bytes
208 # use MCU_FLASH_SIZE since we use KiB in our code
209 MCU_FLASH_SIZE=${flash_size}
213 STARTUP startup_stm32h7${subfamily}xx.s
214 COMPILE_DEFINITIONS ${definitions}
215 LINKER_SCRIPT stm32_flash_h7${subfamily}x${size}
221 define_target_stm32h7(43 i)