SConscript 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/stm32f4xx_hal_msp.c
  10. ''')
  11. if GetDepend(['BSP_USING_ETH']):
  12. src += Glob('ports/phy_reset.c')
  13. if GetDepend(['BSP_USING_SPI_FLASH']):
  14. src += Glob('ports/spi_flash_init.c')
  15. if GetDepend(['BSP_USING_FS']):
  16. src += Glob('ports/drv_filesystem.c')
  17. src += Glob('ports/dfs_romfs.h')
  18. if GetDepend(['BSP_USING_SRAM']):
  19. src += Glob('ports/drv_sram.c')
  20. path = [cwd]
  21. path += [cwd + '/CubeMX_Config/Inc']
  22. path += [cwd + '/ports']
  23. startup_path_prefix = SDK_LIB
  24. if rtconfig.CROSS_TOOL == 'gcc':
  25. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
  26. elif rtconfig.CROSS_TOOL == 'keil':
  27. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
  28. elif rtconfig.CROSS_TOOL == 'iar':
  29. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
  30. CPPDEFINES = ['STM32F407xx']
  31. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  32. Return('group')