SConscript 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import os
  2. import rtconfig
  3. from building import *
  4. Import('SDK_LIB')
  5. cwd = GetCurrentDir()
  6. # add general drivers
  7. src = Split('''
  8. board.c
  9. CubeMX_Config/Src/stm32u5xx_hal_msp.c
  10. ''')
  11. if GetDepend(['BSP_USING_KEY']):
  12. src += Glob('ports/drv_key.c')
  13. if GetDepend(['BSP_USING_SPI_FLASH']):
  14. src += Glob('ports/drv_spi_flash.c')
  15. path = [cwd]
  16. path += [cwd + '/CubeMX_Config/Inc']
  17. startup_path_prefix = SDK_LIB
  18. if rtconfig.PLATFORM in ['gcc']:
  19. src += [startup_path_prefix + '/STM32U5xx_HAL/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/startup_stm32u585xx.s']
  20. elif rtconfig.PLATFORM in ['armcc', 'armclang']:
  21. src += [startup_path_prefix + '/STM32U5xx_HAL/CMSIS/Device/ST/STM32U5xx/Source/Templates/arm/startup_stm32u585xx.s']
  22. elif rtconfig.PLATFORM in ['iccarm']:
  23. src += [startup_path_prefix + '/STM32U5xx_HAL/CMSIS/Device/ST/STM32U5xx/Source/Templates/iar/startup_stm32u585xx.s']
  24. # You can select chips from the list above
  25. CPPDEFINES = ['STM32U575xx']
  26. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  27. Return('group')