2025-12-24 09:54:51 +08:00
|
|
|
import rtconfig
|
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
|
|
Import('SDK_LIB')
|
|
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
|
|
# add the general drivers.
|
|
|
|
|
src = Glob('board.c')
|
|
|
|
|
src += Glob('CubeMX_Config/Src/stm32h7xx_hal_msp.c')
|
2026-01-07 11:41:07 +08:00
|
|
|
# src += Glob('ports/qspi_flash_init.c')
|
2026-04-27 17:35:54 +08:00
|
|
|
src += Glob('ports/fal/*.c')
|
2026-01-07 11:41:07 +08:00
|
|
|
src += Glob('ports/usb/*.c')
|
2025-12-24 09:54:51 +08:00
|
|
|
path = [cwd]
|
|
|
|
|
path += [cwd + '/CubeMX_Config/Inc']
|
2026-01-07 11:41:07 +08:00
|
|
|
path += [cwd + '/ports/usb']
|
2026-04-27 13:09:08 +08:00
|
|
|
path += [cwd + '/ports/fal']
|
2025-12-24 09:54:51 +08:00
|
|
|
|
|
|
|
|
# 这样需要包含 core_cm7.h
|
|
|
|
|
ROOT = os.path.abspath(os.path.join(cwd, '..'))
|
|
|
|
|
path += [os.path.join(ROOT, 'libraries', 'HAL_Drivers', 'CMSIS', 'Include')]
|
|
|
|
|
|
|
|
|
|
startup_path_prefix = SDK_LIB
|
|
|
|
|
|
|
|
|
|
if rtconfig.PLATFORM in ['gcc']:
|
2026-08-05 16:40:21 +08:00
|
|
|
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/gcc/startup_stm32h743xx.s']
|
2025-12-24 09:54:51 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2026-08-05 16:40:21 +08:00
|
|
|
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/arm/startup_stm32h743xx.s']
|
2025-12-24 09:54:51 +08:00
|
|
|
elif rtconfig.PLATFORM in ['iccarm']:
|
2026-08-05 16:40:21 +08:00
|
|
|
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/iar/startup_stm32h743xx.s']
|
2025-12-24 09:54:51 +08:00
|
|
|
|
|
|
|
|
# STM32H743xx || STM32H750xx || STM32F753xx
|
|
|
|
|
# You can select chips from the list above
|
2026-08-05 16:40:21 +08:00
|
|
|
CPPDEFINES = ['STM32H743xx']
|
2025-12-24 09:54:51 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
|
|
Return('group')
|