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/stm32l5xx_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 + '/STM32L5xx_HAL/CMSIS/Device/ST/STM32L5xx/Source/Templates/gcc/startup_stm32l552xx.s'] 22elif rtconfig.PLATFORM in ['armcc', 'armclang']: 23 src += [startup_path_prefix + '/STM32L5xx_HAL/CMSIS/Device/ST/STM32L5xx/Source/Templates/arm/startup_stm32l552xx.s'] 24elif rtconfig.PLATFORM in ['iccarm']: 25 src += [startup_path_prefix + '/STM32L5xx_HAL/CMSIS/Device/ST/STM32L5xx/Source/Templates/iar/startup_stm32l552xx.s'] 26 27# You can select chips from the list above 28CPPDEFINES = ['STM32L552xx'] 29group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 30 31Return('group') 32 33