SConscript 1.3 KB

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