2019-04-15 10:41:36 +08:00
|
|
|
import os
|
2019-03-24 10:41:40 +08:00
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
2019-04-15 10:41:36 +08:00
|
|
|
Import('SDK_LIB')
|
|
|
|
|
2019-03-24 10:41:40 +08:00
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
2019-04-15 10:41:36 +08:00
|
|
|
# add general drivers
|
|
|
|
src = Split('''
|
|
|
|
board.c
|
2019-04-16 09:36:47 +08:00
|
|
|
drv_mpu.c
|
2019-04-15 10:41:36 +08:00
|
|
|
CubeMX_Config/Src/stm32h7xx_hal_msp.c
|
|
|
|
''')
|
2019-03-24 10:41:40 +08:00
|
|
|
|
2019-10-13 14:16:29 +08:00
|
|
|
if GetDepend(['BSP_USING_QSPI_FLASH']):
|
|
|
|
src += Glob('ports/drv_qspi_flash.c')
|
2020-05-17 13:31:18 +08:00
|
|
|
if GetDepend(['BSP_USING_SDMMC']):
|
|
|
|
src += Glob('ports/drv_sdio.c')
|
2019-10-13 14:16:29 +08:00
|
|
|
|
2019-03-24 10:41:40 +08:00
|
|
|
path = [cwd]
|
|
|
|
path += [cwd + '/CubeMX_Config/Inc']
|
2019-04-15 10:41:36 +08:00
|
|
|
path += [cwd + '/ports']
|
|
|
|
|
|
|
|
startup_path_prefix = SDK_LIB
|
2019-03-24 10:41:40 +08:00
|
|
|
|
|
|
|
if rtconfig.CROSS_TOOL == 'gcc':
|
2019-04-15 10:41:36 +08:00
|
|
|
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/gcc/startup_stm32h743xx.s']
|
2019-03-24 10:41:40 +08:00
|
|
|
elif rtconfig.CROSS_TOOL == 'keil':
|
2019-04-15 10:41:36 +08:00
|
|
|
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/arm/startup_stm32h743xx.s']
|
2019-03-24 10:41:40 +08:00
|
|
|
elif rtconfig.CROSS_TOOL == 'iar':
|
2019-04-15 10:41:36 +08:00
|
|
|
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/iar/startup_stm32h743xx.s']
|
2019-03-24 10:41:40 +08:00
|
|
|
|
|
|
|
# STM32H743xx || STM32H750xx || STM32F753xx
|
|
|
|
# You can select chips from the list above
|
|
|
|
CPPDEFINES = ['STM32H743xx']
|
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|