Commit 41952fe9 authored by Vincent Tardy's avatar Vincent Tardy Committed by Erwan Gouriou
Browse files

lib: stm32wba: Link Layer and LE Host libraries dynamic selection



Add BASIC Link Layer and LE Host libraries references in module.yml
Add mechanism in CMakeLists file to select appropriate type of
LL and LE Host libraries according to LE features

Signed-off-by: default avatarVincent Tardy <vincent.tardy@st.com>
parent 1c3f4676
Loading
Loading
Loading
Loading
+39 −5
Original line number Diff line number Diff line
@@ -45,6 +45,26 @@ if(CONFIG_FLASH)
  zephyr_sources(Common/WPAN/Modules/Flash/rf_timing_synchro.c)
endif()

if (CONFIG_BT_EXT_ADV
    OR (CONFIG_BT_PER_ADV OR CONFIG_BT_PER_ADV_SYNC)
    OR CONFIG_BT_SCA_UPDATE
    OR (CONFIG_BT_DF_CTE_RX_AOA OR CONFIG_BT_CTLR_DF_ANT_SWITCH_RX OR CONFIG_BT_CTLR_DF_ANT_SWITCH_TX OR CONFIG_BT_DF_CTE_TX_AOD)
    OR (CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER OR CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER OR CONFIG_BT_CTLR_SYNC_PERIODIC)
    OR CONFIG_BT_ISO_UNICAST
    OR CONFIG_BT_ISO_BROADCASTER
    OR CONFIG_BT_ISO_SYNC_RECEIVER
    OR CONFIG_BT_TRANSMIT_POWER_CONTROL
    OR CONFIG_BT_SUBRATING
    OR CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT
    OR CONFIG_BT_EXT_ADV_CODING_SELECTION)
  message(STATUS "link layer FULL lib selected")
  set(BLE_LIB_TYPE "BLE_LIB_FULL")
else()
  message(STATUS "link layer BASIC lib selected")
  set(BLE_LIB_TYPE "BLE_LIB_BASIC")
endif()

	
set(STM32WBA_BLE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../zephyr/blobs/stm32wba/lib)
set(STM32WBA_BLE_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/ble/stack)
set(STM32WBA_LL_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/link_layer/ll_cmd_lib)
@@ -56,22 +76,36 @@ add_dependencies(
  stm32wba_ble_lib
  stm32wba_ll_lib
)
if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
  set_target_properties(
    stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llobasic.a
  )
elseif (BLE_LIB_TYPE STREQUAL "BLE_LIB_FULL")
  set_target_properties(
    stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llo.a
  )
endif()

# Selecting the proper version of link layer lib according the soc
# Checking all the soc variants and not simply relying on board name 

if(CONFIG_SOC_STM32WBA65XX)
  message(STATUS "STM32WBA6 link layer lib selected")
  if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
    set(LL_LIB "WBA6_LinkLayer_BLE_Basic_lib.a")
  elseif (BLE_LIB_TYPE STREQUAL "BLE_LIB_FULL")
    set(LL_LIB "WBA6_LinkLayer_BLE_Full_lib.a")
  endif()
endif()

if(CONFIG_SOC_STM32WBA55XX OR SOC_STM32WBA52XX)
  message(STATUS "STM32WBA5 link layer lib selected")
  if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
    set(LL_LIB "LinkLayer_BLE_Basic_lib.a")
  elseif (BLE_LIB_TYPE STREQUAL "BLE_LIB_FULL")
    set(LL_LIB "LinkLayer_BLE_Full_lib.a")
  endif()
endif()

# Using the selected version of link layer lib
set_target_properties(stm32wba_ll_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/${LL_LIB})
+21 −0
Original line number Diff line number Diff line
@@ -11,6 +11,13 @@ blobs:
    license-path: zephyr/blobs/stm32wba/lib/license.md
    url: https://github.com/STMicroelectronics/STM32CubeWBA/raw/v1.6.0/Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/lib/WBA6_LinkLayer_BLE_Full_lib.a
    description: "Binary Link Layer library for the STM32WBA6 Bluetooth subsystem"
  - path: stm32wba/lib/WBA6_LinkLayer_BLE_Basic_lib.a
    sha256: aefc7ce2360d12bac52ff38741fcd40cfb0fecf4eff657b2d32b2986dd4165e2
    type: lib
    version: '1.6.0'
    license-path: zephyr/blobs/stm32wba/lib/license.md
    url: https://github.com/STMicroelectronics/STM32CubeWBA/raw/v1.6.0/Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/lib/WBA6_LinkLayer_BLE_Basic_lib.a
    description: "Binary Link Layer library for the STM32WBA6 Bluetooth subsystem"
  - path: stm32wba/lib/LinkLayer_BLE_Full_lib.a
    sha256: c935072ee0d98ddaec3b7f4a1e502ade9768c3fe8056101823a3f19327a1b148
    type: lib
@@ -18,6 +25,13 @@ blobs:
    license-path: zephyr/blobs/stm32wba/lib/license.md
    url: https://github.com/STMicroelectronics/STM32CubeWBA/raw/v1.6.0/Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/lib/LinkLayer_BLE_Full_lib.a
    description: "Binary Link Layer library for the STM32WBA5 Bluetooth subsystem"
  - path: stm32wba/lib/LinkLayer_BLE_Basic_lib.a
    sha256: 6a028bba47a11e96d7a63b906d2f1c3c2c5b2d8b0227859f94803c746a1d74b0
    type: lib
    version: '1.6.0'
    license-path: zephyr/blobs/stm32wba/lib/license.md
    url: https://github.com/STMicroelectronics/STM32CubeWBA/raw/v1.6.0/Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/lib/LinkLayer_BLE_Basic_lib.a
    description: "Binary Link Layer library for the STM32WBA5 Bluetooth subsystem"
  - path: stm32wba/lib/stm32wba_ble_stack_llo.a
    sha256: 70c881f8492ba712c658ab2c4682b60d62bf14d3d55822a611702b32b286c9b1
    type: lib
@@ -25,6 +39,13 @@ blobs:
    license-path: zephyr/blobs/stm32wba/lib/license.md
    url: https://github.com/STMicroelectronics/STM32CubeWBA/raw/v1.6.0/Middlewares/ST/STM32_WPAN/ble/stack/lib/stm32wba_ble_stack_llo.a
    description: "Binary Stack library for the STM32WBA Bluetooth subsystem"
  - path: stm32wba/lib/stm32wba_ble_stack_llobasic.a
    sha256: e4008830f7d3284a8e2634e80120e4f5fb145ec0fdbfa96a0be0b4363b605411
    type: lib
    version: '1.6.0'
    license-path: zephyr/blobs/stm32wba/lib/license.md
    url: https://github.com/STMicroelectronics/STM32CubeWBA/raw/v1.6.0/Middlewares/ST/STM32_WPAN/ble/stack/lib/stm32wba_ble_stack_llobasic.a
    description: "Binary Stack library for the STM32WBA Bluetooth subsystem"
  - path: stm32wb0/lib/stm32wb0x_ble_stack_controller_only.a
    sha256: 54bf69acaa59afc368132f8170e9910858a2c801538494d8de96fa567c02e233
    type: lib