SConscript 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_SDCARD']):
  16. src += Glob('ports/sdcard_port.c')
  17. if GetDepend(['BSP_USING_EXT_FMC_IO']):
  18. src += Glob('ports/drv_ext_io.c')
  19. path = [cwd]
  20. path += [cwd + '/CubeMX_Config/Inc']
  21. path += [cwd + '/ports']
  22. startup_path_prefix = SDK_LIB
  23. if rtconfig.CROSS_TOOL == 'gcc':
  24. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s']
  25. elif rtconfig.CROSS_TOOL == 'keil':
  26. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s']
  27. elif rtconfig.CROSS_TOOL == 'iar':
  28. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f429xx.s']
  29. CPPDEFINES = ['STM32F429xx']
  30. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  31. Return('group')