2018-12-14 09:44:05 +08:00
|
|
|
import os
|
2018-12-10 21:39:28 +08:00
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
2018-12-14 09:44:05 +08:00
|
|
|
Import('SDK_LIB')
|
|
|
|
|
2018-12-10 21:39:28 +08:00
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
2018-12-14 09:44:05 +08:00
|
|
|
# add general drivers
|
|
|
|
src = Split('''
|
|
|
|
board.c
|
|
|
|
CubeMX_Config/Src/stm32f7xx_hal_msp.c
|
|
|
|
''')
|
2018-12-10 21:39:28 +08:00
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_ETH']):
|
|
|
|
src += Glob('ports/phy_reset.c')
|
|
|
|
|
2018-12-12 16:49:27 +08:00
|
|
|
if GetDepend(['BSP_USING_QSPI_FLASH']):
|
2018-12-14 09:44:05 +08:00
|
|
|
src += Glob('ports/drv_qspi_flash.c')
|
2018-12-10 21:39:28 +08:00
|
|
|
|
2019-01-15 16:17:01 +08:00
|
|
|
if GetDepend(['BSP_USING_SDCARD']):
|
|
|
|
src += Glob('ports/sdcard_port.c')
|
|
|
|
|
2018-12-14 09:44:05 +08:00
|
|
|
path = [cwd]
|
2018-12-10 21:39:28 +08:00
|
|
|
path += [cwd + '/CubeMX_Config/Inc']
|
|
|
|
path += [cwd + '/ports']
|
|
|
|
|
2018-12-14 09:44:05 +08:00
|
|
|
startup_path_prefix = SDK_LIB
|
2018-12-10 21:39:28 +08:00
|
|
|
|
2022-04-20 09:56:04 +08:00
|
|
|
if rtconfig.PLATFORM == 'gcc':
|
2018-12-14 09:44:05 +08:00
|
|
|
src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/gcc/startup_stm32f767xx.s']
|
2022-04-20 09:56:04 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2018-12-14 09:44:05 +08:00
|
|
|
src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/arm/startup_stm32f767xx.s']
|
2018-12-10 21:39:28 +08:00
|
|
|
elif rtconfig.CROSS_TOOL == 'iar':
|
2018-12-14 09:44:05 +08:00
|
|
|
src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/iar/startup_stm32f767xx.s']
|
2018-12-10 21:39:28 +08:00
|
|
|
|
|
|
|
CPPDEFINES = ['STM32F767xx']
|
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|