STM32CubeWB.scons 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Import("env")
  2. env.Append(
  3. CPPPATH=[
  4. "#/lib/STM32CubeWB/Drivers/CMSIS/Device/ST/STM32WBxx/Include",
  5. "#/lib/STM32CubeWB/Drivers/CMSIS/Include",
  6. "#/lib/STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Inc",
  7. "#/lib/STM32CubeWB/Middlewares/ST/STM32_WPAN",
  8. ],
  9. CPPDEFINES=[
  10. "STM32WB",
  11. "STM32WB55xx",
  12. "USE_FULL_ASSERT",
  13. "USE_FULL_LL_DRIVER",
  14. ],
  15. SDK_HEADERS=env.GlobRecursive(
  16. "*_ll_*.h",
  17. Dir("STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Inc/"),
  18. exclude="*usb.h",
  19. ),
  20. )
  21. if env["RAM_EXEC"]:
  22. env.Append(
  23. CPPDEFINES=[
  24. "VECT_TAB_SRAM",
  25. ],
  26. )
  27. libenv = env.Clone(FW_LIB_NAME="stm32cubewb")
  28. libenv.Append(
  29. CPPPATH=[
  30. "#/lib/STM32CubeWB/Middlewares/ST/STM32_WPAN/ble",
  31. "#/lib/STM32CubeWB/Middlewares/ST/STM32_WPAN/ble/core",
  32. "#/lib/STM32CubeWB/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread",
  33. "#/lib/STM32CubeWB/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci",
  34. "#/lib/STM32CubeWB/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl",
  35. "#/lib/STM32CubeWB/Middlewares/ST/STM32_WPAN/utilities",
  36. ]
  37. )
  38. libenv.ApplyLibFlags()
  39. sources = libenv.GlobRecursive(
  40. "*_ll_*.c", "STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Src/", exclude="*usb.c"
  41. )
  42. sources += Glob(
  43. "STM32CubeWB/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/*.c",
  44. source=True,
  45. )
  46. sources += Glob(
  47. "STM32CubeWB/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/*_tl*.c",
  48. source=True,
  49. )
  50. sources += [
  51. "STM32CubeWB/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c",
  52. "STM32CubeWB/Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c",
  53. "STM32CubeWB/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.c",
  54. "STM32CubeWB/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gatt_aci.c",
  55. "STM32CubeWB/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hal_aci.c",
  56. "STM32CubeWB/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hci_le.c",
  57. "STM32CubeWB/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_l2cap_aci.c",
  58. "STM32CubeWB/Middlewares/ST/STM32_WPAN/ble/core/template/osal.c",
  59. "STM32CubeWB/Middlewares/ST/STM32_WPAN/utilities/dbg_trace.c",
  60. "STM32CubeWB/Middlewares/ST/STM32_WPAN/utilities/otp.c",
  61. "STM32CubeWB/Middlewares/ST/STM32_WPAN/utilities/stm_list.c",
  62. ]
  63. lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
  64. libenv.Install("${LIB_DIST_DIR}", lib)
  65. Return("lib")