SConscript 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import os
  2. import rtconfig
  3. from building import *
  4. cwd = GetCurrentDir()
  5. # add general drivers
  6. src = Glob('board.c')
  7. src += Glob('CubeMX_Config/Src/stm32f4xx_hal_msp.c')
  8. if GetDepend(['BSP_USING_ETH']):
  9. src += Glob('ports/phy_reset.c')
  10. if GetDepend(['BSP_USING_SPI_FLASH']):
  11. src += Glob('ports/spi_flash_init.c')
  12. path = [cwd]
  13. path += [cwd + '/CubeMX_Config/Inc']
  14. path += [cwd + '/ports']
  15. if os.path.exists(cwd + '/../libraries'):
  16. startup_path_prefix = cwd + '/../libraries'
  17. else:
  18. startup_path_prefix = cwd + '/../../libraries'
  19. if rtconfig.CROSS_TOOL == 'gcc':
  20. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s']
  21. elif rtconfig.CROSS_TOOL == 'keil':
  22. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s']
  23. elif rtconfig.CROSS_TOOL == 'iar':
  24. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f429xx.s']
  25. CPPDEFINES = ['STM32F429xx']
  26. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  27. Return('group')