SConscript 1.1 KB

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