SConscript 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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/stm32f1xx_hal_msp.c
  10. ''')
  11. if GetDepend(['BSP_USING_SPI_FLASH']):
  12. src += Glob('ports/spi_flash_init.c')
  13. path = [cwd]
  14. path += [cwd + '/CubeMX_Config/Inc']
  15. path += [cwd + '/ports']
  16. startup_path_prefix = SDK_LIB
  17. if rtconfig.PLATFORM in ['gcc']:
  18. src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xe.s']
  19. elif rtconfig.PLATFORM in ['armcc', 'armclang']:
  20. src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xe.s']
  21. elif rtconfig.PLATFORM in ['iccarm']:
  22. src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']
  23. # STM32F100xB || STM32F100xE || STM32F101x6
  24. # STM32F101xB || STM32F101xE || STM32F101xG
  25. # STM32F102x6 || STM32F102xB || STM32F103x6
  26. # STM32F103xB || STM32F103xE || STM32F103xG
  27. # STM32F105xC || STM32F107xC)
  28. # You can select chips from the list above
  29. CPPDEFINES = ['STM32F103xE']
  30. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  31. Return('group')