SConscript 1.4 KB

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