SConscript 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import rtconfig
  2. Import('RTT_ROOT')
  3. from building import *
  4. # get current directory
  5. cwd = GetCurrentDir()
  6. # The set of source files associated with this SConscript file.
  7. src = Split("""
  8. CMSIS/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
  9. """)
  10. src += Glob('STM32F4xx_StdPeriph_Driver/src/*.c')
  11. # starupt scripts for each STM32 kind
  12. # startup_scripts = {}
  13. # startup_scripts['STM32F10X_CL'] = 'startup_stm32f10x_cl.s'
  14. # startup_scripts['STM32F10X_HD'] = 'startup_stm32f10x_hd.s'
  15. # startup_scripts['STM32F10X_HD_VL'] = 'startup_stm32f10x_hd_vl.s'
  16. # startup_scripts['STM32F10X_LD'] = 'startup_stm32f10x_ld.s'
  17. # startup_scripts['STM32F10X_LD_VL'] = 'startup_stm32f10x_ld_vl.s'
  18. # startup_scripts['STM32F10X_MD'] = 'startup_stm32f10x_md.s'
  19. # startup_scripts['STM32F10X_MD_VL'] = 'startup_stm32f10x_md_vl.s'
  20. # startup_scripts['STM32F10X_XL'] = 'startup_stm32f10x_xl.s'
  21. #add for startup script
  22. if rtconfig.CROSS_TOOL == 'gcc':
  23. src = src + ['CMSIS/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f4xx.s']
  24. elif rtconfig.CROSS_TOOL == 'keil':
  25. src = src + ['CMSIS/ST/STM32F4xx/Source/Templates/arm/startup_stm32f4xx.s']
  26. # elif rtconfig.CROSS_TOOL == 'iar':
  27. # src = src + ['CMSIS/CM3/DeviceSupport/ST/STM32F10x/startup/iar/' + startup_scripts[rtconfig.STM32_TYPE]]
  28. path = [cwd + '/STM32F4xx_StdPeriph_Driver/inc',
  29. cwd + '/CMSIS/ST/STM32F4xx/Include',
  30. cwd + '/CMSIS/Include',
  31. cwd + '/CMSIS/CM3/DeviceSupport/ST/STM32F10x']
  32. #CPPDEFINES = ['USE_STDPERIPH_DRIVER', rtconfig.STM32_TYPE]
  33. CPPDEFINES = ['USE_STDPERIPH_DRIVER']
  34. group = DefineGroup('STM32_StdPeriph', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  35. Return('group')