1import os 2import rtconfig 3from building import * 4 5Import('SDK_LIB') 6 7cwd = GetCurrentDir() 8 9# add general drivers 10src = Split(''' 11board.c 12CubeMX_Config/Src/stm32f0xx_hal_msp.c 13''') 14 15path = [cwd] 16path += [cwd + '/CubeMX_Config/Inc'] 17 18startup_path_prefix = SDK_LIB 19 20if rtconfig.PLATFORM in ['gcc']: 21 src += [startup_path_prefix + '/STM32F0xx_HAL/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f091xc.s'] 22elif rtconfig.PLATFORM in ['armcc', 'armclang']: 23 src += [startup_path_prefix + '/STM32F0xx_HAL/CMSIS/Device/ST/STM32F0xx/Source/Templates/arm/startup_stm32f091xc.s'] 24elif rtconfig.PLATFORM in ['iccarm']: 25 src += [startup_path_prefix + '/STM32F0xx_HAL/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/startup_stm32f091xc.s'] 26 27# STM32F030x6 || STM32F030x8 || STM32F031x6 28# STM32F038xx || STM32F042x6 || STM32F048xx 29# STM32F070x6 || STM32F051x8 || STM32F058xx 30# STM32F071xB || STM32F072xB || STM32F078xx 31# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC 32# You can select chips from the list above 33CPPDEFINES = ['STM32F091xC'] 34group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 35Return('group') 36