SConscript 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. drv_mpu.c
  10. CubeMX_Config/Src/stm32h7xx_hal_msp.c
  11. ''')
  12. if GetDepend(['BSP_USING_QSPI_FLASH']):
  13. src += Glob('ports/drv_qspi_flash.c')
  14. if GetDepend(['BSP_USING_SDMMC']):
  15. src += Glob('ports/drv_sdio.c')
  16. path = [cwd]
  17. path += [cwd + '/CubeMX_Config/Inc']
  18. path += [cwd + '/ports']
  19. startup_path_prefix = SDK_LIB
  20. if rtconfig.CROSS_TOOL == 'gcc':
  21. src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/gcc/startup_stm32h743xx.s']
  22. elif rtconfig.CROSS_TOOL == 'keil':
  23. src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/arm/startup_stm32h743xx.s']
  24. elif rtconfig.CROSS_TOOL == 'iar':
  25. src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/iar/startup_stm32h743xx.s']
  26. # STM32H743xx || STM32H750xx || STM32F753xx
  27. # You can select chips from the list above
  28. CPPDEFINES = ['STM32H743xx']
  29. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  30. Return('group')