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/stm32f4xx_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 + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s'] 22elif rtconfig.PLATFORM in ['armcc', 'armclang']: 23 src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s'] 24elif rtconfig.PLATFORM in ['iccarm']: 25 src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s'] 26 27# STM32F405xx) || STM32F415xx) || STM32F407xx) || STM32F417xx) 28# STM32F427xx) || STM32F437xx) || STM32F429xx) || STM32F439xx) 29# STM32F401xC) || STM32F401xE) || STM32F410Tx) || STM32F410Cx) 30# STM32F410Rx) || STM32F411xE) || STM32F446xx) || STM32F469xx) 31# STM32F479xx) || STM32F412Cx) || STM32F412Rx) || STM32F412Vx) 32# STM32F412Zx) || STM32F413xx) || STM32F423xx) 33# You can select chips from the list above 34CPPDEFINES = ['STM32F407xx'] 35group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 36 37Return('group') 38