SConscript 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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/Common/System/system_stm32mp1xx.c
  10. CubeMX_Config/CM4/Src/stm32mp1xx_hal_msp.c
  11. ''')
  12. if GetDepend(['BSP_USING_RCC']):
  13. src += Glob('ports/drv_rcc.c')
  14. if GetDepend(['BSP_USING_EXTI']):
  15. src += Glob('ports/drv_exti.c')
  16. if GetDepend(['BSP_USING_PWR']):
  17. src += Glob('ports/drv_pwr.c')
  18. if GetDepend(['BSP_USING_WWDG']):
  19. src += Glob('ports/drv_wwdg.c')
  20. if GetDepend(['BSP_USING_LPTIM']):
  21. src += Glob('ports/drv_lptim.c')
  22. if GetDepend(['BSP_USING_TIM14']):
  23. src += Glob('ports/timer_sample.c')
  24. if GetDepend(['BSP_USING_PMIC']):
  25. src += Glob('ports/drv_pmic.c')
  26. path = [cwd]
  27. path += [cwd + '/CubeMX_Config/CM4/Inc']
  28. path += [cwd + '/ports']
  29. startup_path_prefix = SDK_LIB
  30. if rtconfig.CROSS_TOOL == 'gcc':
  31. src += [startup_path_prefix + '/STM32MPxx_HAL/CMSIS/Device/ST/STM32MP1xx/Source/Templates/gcc/startup_stm32mp15xx.s']
  32. elif rtconfig.CROSS_TOOL == 'keil':
  33. src += [startup_path_prefix + '/STM32MPxx_HAL/CMSIS/Device/ST/STM32MP1xx/Source/Templates/arm/startup_stm32mp15xx.s']
  34. elif rtconfig.CROSS_TOOL == 'iar':
  35. src += [startup_path_prefix + '/STM32MPxx_HAL/CMSIS/Device/ST/STM32MP1xx/Source/Templates/iar/startup_stm32mp15xx.s']
  36. CPPDEFINES = ['CORE_CM4','NO_ATOMIC_64_SUPPORT','METAL_INTERNAL','METAL_MAX_DEVICE_REGIONS=2','VIRTIO_SLAVE_ONLY','STM32MP157Axx','__LOG_TRACE_IO_']
  37. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  38. Return('group')