122 lines
6.4 KiB
Python
122 lines
6.4 KiB
Python
|
import rtconfig
|
||
|
Import('RTT_ROOT')
|
||
|
from building import *
|
||
|
|
||
|
# get current directory
|
||
|
cwd = GetCurrentDir()
|
||
|
|
||
|
# The set of source files associated with this SConscript file.
|
||
|
src = Split("""
|
||
|
CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_crc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_irda.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_smartcard.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi_ex.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_usart.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_wwdg.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_adc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_crc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dac.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_i2c.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rtc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_sdmmc.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_spi.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_tim.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c
|
||
|
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c
|
||
|
|
||
|
""")
|
||
|
if rtconfig.STM32_TYPE == 'STM32F100xB' or rtconfig.STM32_TYPE == 'STM32F100xE':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cec.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F103x6' or rtconfig.STM32_TYPE == 'STM32F103xB' or rtconfig.STM32_TYPE == 'STM32F103xE' or rtconfig.STM32_TYPE == 'STM32F103xG' or rtconfig.STM32_TYPE == 'STM32F105xC' or rtconfig.STM32_TYPE == 'STM32F107xC':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F100xB' or rtconfig.STM32_TYPE == 'STM32F100xE' or rtconfig.STM32_TYPE == 'STM32F101xE' or rtconfig.STM32_TYPE == 'STM32F101xG' or rtconfig.STM32_TYPE == 'STM32F103xE' or rtconfig.STM32_TYPE == 'STM32F103xG' or rtconfig.STM32_TYPE == 'STM32F105xC' or rtconfig.STM32_TYPE == 'STM32F107xC':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac_ex.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F107xC':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_eth.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F107xC' or rtconfig.STM32_TYPE == 'STM32F105xC':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_hcd.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F107xC' or rtconfig.STM32_TYPE == 'STM32F105xC' or rtconfig.STM32_TYPE == 'STM32F103xE' or rtconfig.STM32_TYPE == 'STM32F103xG':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2s.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F103xE' or rtconfig.STM32_TYPE == 'STM32F103xG':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_mmc.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sd.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F101xE' or rtconfig.STM32_TYPE == 'STM32F103xE' or rtconfig.STM32_TYPE == 'STM32F101xG' or rtconfig.STM32_TYPE == 'STM32F103xG':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nand.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pccard.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F101xE' or rtconfig.STM32_TYPE == 'STM32F103xE' or rtconfig.STM32_TYPE == 'STM32F101xG' or rtconfig.STM32_TYPE == 'STM32F103xG' or rtconfig.STM32_TYPE == 'STM32F100xE':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nor.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c']
|
||
|
|
||
|
if rtconfig.STM32_TYPE == 'STM32F102x6' or rtconfig.STM32_TYPE == 'STM32F102xB' or rtconfig.STM32_TYPE == 'STM32F103x6' or rtconfig.STM32_TYPE == 'STM32F103xB' or rtconfig.STM32_TYPE == 'STM32F103xE' or rtconfig.STM32_TYPE == 'STM32F103xG' or rtconfig.STM32_TYPE == 'STM32F105xC' or rtconfig.STM32_TYPE == 'STM32F107xC':
|
||
|
src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c']
|
||
|
|
||
|
# starupt scripts for each STM32 kind
|
||
|
startup_scripts = {}
|
||
|
startup_scripts['STM32F100xB'] = 'startup_stm32f100xb.s'
|
||
|
startup_scripts['STM32F100xE'] = 'startup_stm32f100xe.s'
|
||
|
startup_scripts['STM32F101x6'] = 'startup_stm32f101x6.s'
|
||
|
startup_scripts['STM32F101xB'] = 'startup_stm32f101xb.s'
|
||
|
startup_scripts['STM32F101xE'] = 'startup_stm32f101xe.s'
|
||
|
startup_scripts['STM32F101xG'] = 'startup_stm32f101xg.s'
|
||
|
startup_scripts['STM32F102x6'] = 'startup_stm32f102x6.s'
|
||
|
startup_scripts['STM32F102xB'] = 'startup_stm32f102xb.s'
|
||
|
startup_scripts['STM32F103x6'] = 'startup_stm32f103x6.s'
|
||
|
startup_scripts['STM32F103xB'] = 'startup_stm32f103xb.s'
|
||
|
startup_scripts['STM32F103xE'] = 'startup_stm32f103xe.s'
|
||
|
startup_scripts['STM32F103xG'] = 'startup_stm32f103xe.s'
|
||
|
startup_scripts['STM32F105xC'] = 'startup_stm32f105xc.s'
|
||
|
startup_scripts['STM32F107xC'] = 'startup_stm32f107xc.s'
|
||
|
|
||
|
# add for startup script
|
||
|
if rtconfig.CROSS_TOOL == 'gcc':
|
||
|
src = src + ['CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/' + startup_scripts[rtconfig.STM32_TYPE]]
|
||
|
elif rtconfig.CROSS_TOOL == 'keil':
|
||
|
src = src + ['CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/' + startup_scripts[rtconfig.STM32_TYPE]]
|
||
|
elif rtconfig.CROSS_TOOL == 'iar':
|
||
|
src = src + ['CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/' + startup_scripts[rtconfig.STM32_TYPE]]
|
||
|
|
||
|
path = [cwd + '/CMSIS/Device/ST/STM32F1xx/Include',
|
||
|
cwd + '/STM32F1xx_HAL_Driver/Inc',
|
||
|
cwd + '/CMSIS/Include']
|
||
|
|
||
|
if GetDepend(['RT_USING_RTT_CMSIS']):
|
||
|
path += [RTT_ROOT + '/components/CMSIS/Include']
|
||
|
|
||
|
CPPDEFINES = ['USE_HAL_DRIVER', rtconfig.STM32_TYPE]
|
||
|
group = DefineGroup('STM32_HAL', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
||
|
|
||
|
Return('group')
|