SConscript 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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/stm32f7xx_hal_msp.c
  10. ''')
  11. if GetDepend(['BSP_USING_ETH']):
  12. src += Glob('ports/phy_reset.c')
  13. if GetDepend(['BSP_USING_QSPI_FLASH']):
  14. src += Glob('ports/drv_qspi_flash.c')
  15. if GetDepend(['BSP_USING_SDCARD']):
  16. src += Glob('ports/sdcard_port.c')
  17. path = [cwd]
  18. path += [cwd + '/CubeMX_Config/Inc']
  19. path += [cwd + '/ports']
  20. startup_path_prefix = SDK_LIB
  21. if rtconfig.CROSS_TOOL == 'gcc':
  22. src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/gcc/startup_stm32f767xx.s']
  23. elif rtconfig.CROSS_TOOL == 'keil':
  24. src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/arm/startup_stm32f767xx.s']
  25. elif rtconfig.CROSS_TOOL == 'iar':
  26. src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/iar/startup_stm32f767xx.s']
  27. CPPDEFINES = ['STM32F767xx']
  28. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  29. Return('group')