1
0

SConscript 1.3 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/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. if GetDepend(['BSP_USING_SPI_FLASH_LITTLEFS']):
  18. src += Glob('ports/fal_spi_flash_sfud_port.c')
  19. if GetDepend(['BSP_USING_SRAM']):
  20. src += Glob('ports/drv_sram.c')
  21. path = [cwd]
  22. path += [cwd + '/CubeMX_Config/Inc']
  23. path += [cwd + '/ports']
  24. startup_path_prefix = SDK_LIB
  25. if rtconfig.CROSS_TOOL == 'gcc':
  26. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
  27. elif rtconfig.CROSS_TOOL == 'keil':
  28. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
  29. elif rtconfig.CROSS_TOOL == 'iar':
  30. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
  31. CPPDEFINES = ['STM32F407xx']
  32. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  33. Return('group')