1
0

SConscript 1.4 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_SPI_FLASH']):
  12. src += Glob('ports/spi_flash_init.c')
  13. if GetDepend(['BSP_USING_SDCARD']):
  14. src += Glob('ports/sdcard_port.c')
  15. path = [cwd]
  16. path += [cwd + '/CubeMX_Config/Inc']
  17. path += [cwd + '/ports']
  18. startup_path_prefix = SDK_LIB
  19. if rtconfig.CROSS_TOOL == 'gcc':
  20. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
  21. elif rtconfig.CROSS_TOOL == 'keil':
  22. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
  23. elif rtconfig.CROSS_TOOL == 'iar':
  24. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
  25. # STM32F405xx) || STM32F415xx) || STM32F407xx) || STM32F417xx)
  26. # STM32F427xx) || STM32F437xx) || STM32F429xx) || STM32F439xx)
  27. # STM32F401xC) || STM32F401xE) || STM32F410Tx) || STM32F410Cx)
  28. # STM32F410Rx) || STM32F411xE) || STM32F446xx) || STM32F469xx)
  29. # STM32F479xx) || STM32F412Cx) || STM32F412Rx) || STM32F412Vx)
  30. # STM32F412Zx) || STM32F413xx) || STM32F423xx)
  31. # You can select chips from the list above
  32. CPPDEFINES = ['STM32F407xx']
  33. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  34. Return('group')