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 """) #device options if GetDepend(['STM32F100RC']) or GetDepend(['STM32F100RC']) or GetDepend(['STM32F100RC']) or GetDepend(['STM32F100RD']) or GetDepend(['STM32F100RE']) or GetDepend(['STM32F100VD']) or GetDepend(['STM32F100VE']) or GetDepend(['STM32F100ZD']) or GetDepend(['STM32F100ZE']): STM32_TYPE = 'STM32F100xE' if GetDepend(['STM32F101TB']) or GetDepend(['STM32F101CB']) or GetDepend(['STM32F101RB']) or GetDepend(['STM32F101VB']): STM32_TYPE = 'STM32F101xB' if GetDepend(['STM32F101RC']) or GetDepend(['STM32F101VC']) or GetDepend(['STM32F101ZC']) or GetDepend(['STM32F101RD']) or GetDepend(['STM32F101RE']) or GetDepend(['STM32F101VD']) or GetDepend(['STM32F101VE']) or GetDepend(['STM32F101ZD']) or GetDepend(['STM32F101ZE']): STM32_TYPE = 'STM32F101xE' if GetDepend(['STM32F101RF']) or GetDepend(['STM32F101RG']) or GetDepend(['STM32F101VF']) or GetDepend(['STM32F101VG']) or GetDepend(['STM32F101ZF']) or GetDepend(['STM32F101ZG']): STM32_TYPE = 'STM32F101xG' if GetDepend(['STM32F102CB']) or GetDepend(['STM32F102RB']): STM32_TYPE = 'STM32F102xB' if GetDepend(['STM32F103T8']) or GetDepend(['STM32F103TB']) or GetDepend(['STM32F103C8']) or GetDepend(['STM32F103CB']) or GetDepend(['STM32F103R8']) or GetDepend(['STM32F103RB']) or GetDepend(['STM32F103V8']) or GetDepend(['STM32F103VB']): STM32_TYPE = 'STM32F103xB' if GetDepend(['STM32F103RC']) or GetDepend(['STM32F103VC']) or GetDepend(['STM32F103ZC']) or GetDepend(['STM32F103RD']) or GetDepend(['STM32F103RE']) or GetDepend(['STM32F103VD']) or GetDepend(['STM32F103VE']) or GetDepend(['STM32F103ZD']) or GetDepend(['STM32F103ZE']): STM32_TYPE = 'STM32F103xE' if GetDepend(['STM32F103RF']) or GetDepend(['STM32F103RG']) or GetDepend(['STM32F103VF']) or GetDepend(['STM32F103VG']) or GetDepend(['STM32F103ZF']) or GetDepend(['STM32F103ZG']): STM32_TYPE = 'STM32F103xG' if GetDepend(['STM32F105R8']) or GetDepend(['STM32F105RB']) or GetDepend(['STM32F105RC']) or GetDepend(['STM32F105V8']) or GetDepend(['STM32F105VB']) or GetDepend(['STM32F105VC']): STM32_TYPE = 'STM32F105xC' if GetDepend(['STM32F107RB']) or GetDepend(['STM32F107RC']) or GetDepend(['STM32F107VB']) or GetDepend(['STM32F107VC']): STM32_TYPE = 'STM32F107xC' if STM32_TYPE == 'STM32F100xB' or STM32_TYPE == 'STM32F100xE': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cec.c'] if STM32_TYPE == 'STM32F103x6' or STM32_TYPE == 'STM32F103xB' or STM32_TYPE == 'STM32F103xE' or STM32_TYPE == 'STM32F103xG' or STM32_TYPE == 'STM32F105xC' or STM32_TYPE == 'STM32F107xC': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c'] if STM32_TYPE == 'STM32F100xB' or STM32_TYPE == 'STM32F100xE' or STM32_TYPE == 'STM32F101xE' or STM32_TYPE == 'STM32F101xG' or STM32_TYPE == 'STM32F103xE' or STM32_TYPE == 'STM32F103xG' or STM32_TYPE == 'STM32F105xC' or STM32_TYPE == 'STM32F107xC': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac_ex.c'] if STM32_TYPE == 'STM32F107xC': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_eth.c'] if STM32_TYPE == 'STM32F107xC' or STM32_TYPE == 'STM32F105xC': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_hcd.c'] if STM32_TYPE == 'STM32F107xC' or STM32_TYPE == 'STM32F105xC' or STM32_TYPE == 'STM32F103xE' or STM32_TYPE == 'STM32F103xG': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2s.c'] if STM32_TYPE == 'STM32F103xE' or STM32_TYPE == 'STM32F103xG': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_mmc.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sd.c'] if STM32_TYPE == 'STM32F101xE' or STM32_TYPE == 'STM32F103xE' or STM32_TYPE == 'STM32F101xG' or STM32_TYPE == 'STM32F103xG': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nand.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pccard.c'] if STM32_TYPE == 'STM32F101xE' or STM32_TYPE == 'STM32F103xE' or STM32_TYPE == 'STM32F101xG' or STM32_TYPE == 'STM32F103xG' or STM32_TYPE == 'STM32F100xE': src = src + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nor.c'] + ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c'] if STM32_TYPE == 'STM32F102x6' or STM32_TYPE == 'STM32F102xB' or STM32_TYPE == 'STM32F103x6' or STM32_TYPE == 'STM32F103xB' or STM32_TYPE == 'STM32F103xE' or STM32_TYPE == 'STM32F103xG' or STM32_TYPE == 'STM32F105xC' or 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[STM32_TYPE]] elif rtconfig.CROSS_TOOL == 'keil': src = src + ['CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/' + startup_scripts[STM32_TYPE]] elif rtconfig.CROSS_TOOL == 'iar': src = src + ['CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/' + startup_scripts[STM32_TYPE]] path = [cwd + '/CMSIS/Device/ST/STM32F1xx/Include', cwd + '/STM32F1xx_HAL_Driver/Inc', cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER',STM32_TYPE] group = DefineGroup('STM32_HAL', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) Return('group')