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/stm32l4xx_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 + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s'] 22elif rtconfig.PLATFORM in ['armcc', 'armclang']: 23 src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s'] 24elif rtconfig.PLATFORM in ['iccarm']: 25 src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s'] 26 27# STM32L412xx || STM32L422xx || STM32L431xx 28# STM32L432xx || STM32L433xx || STM32L442xx 29# STM32L443xx || STM32L451xx || STM32L452xx 30# STM32L462xx || STM32L471xx || STM32L475xx 31# STM32L476xx || STM32L485xx || STM32L486xx 32# STM32L496xx || STM32L4A6xx || STM32L4R5xx 33# STM32L4R7xx || STM32L4R9xx || STM32L4S5xx 34# STM32L4S7xx || STM32L4S9xx 35# You can select chips from the list above 36CPPDEFINES = ['STM32L475xx'] 37group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 38 39Return('group') 40 41