Skip to content

Commit 8d5d58e

Browse files
committed
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: Vincent Tardy <vincent.tardy@st.com>
1 parent 54f5a6e commit 8d5d58e

File tree

2 files changed

+60
-5
lines changed

2 files changed

+60
-5
lines changed

lib/stm32wba/CMakeLists.txt

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ if(CONFIG_FLASH)
4545
zephyr_sources(Common/WPAN/Modules/Flash/rf_timing_synchro.c)
4646
endif()
4747

48+
if (CONFIG_BT_EXT_ADV
49+
OR (CONFIG_BT_PER_ADV OR CONFIG_BT_PER_ADV_SYNC)
50+
OR CONFIG_BT_SCA_UPDATE
51+
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)
52+
OR (CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER OR CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER OR CONFIG_BT_CTLR_SYNC_PERIODIC)
53+
OR CONFIG_BT_ISO_UNICAST
54+
OR CONFIG_BT_ISO_BROADCASTER
55+
OR CONFIG_BT_ISO_SYNC_RECEIVER
56+
OR CONFIG_BT_TRANSMIT_POWER_CONTROL
57+
OR CONFIG_BT_SUBRATING
58+
OR CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT
59+
OR CONFIG_BT_EXT_ADV_CODING_SELECTION)
60+
message(STATUS "link layer FULL lib selected")
61+
set(BLE_LIB_TYPE "BLE_LIB_FULL")
62+
else()
63+
message(STATUS "link layer BASIC lib selected")
64+
set(BLE_LIB_TYPE "BLE_LIB_BASIC")
65+
endif()
66+
67+
4868
set(STM32WBA_BLE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../zephyr/blobs/stm32wba/lib)
4969
set(STM32WBA_BLE_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/ble/stack)
5070
set(STM32WBA_LL_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/link_layer/ll_cmd_lib)
@@ -56,21 +76,35 @@ add_dependencies(
5676
stm32wba_ble_lib
5777
stm32wba_ll_lib
5878
)
59-
set_target_properties(
60-
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llo.a
61-
)
79+
if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
80+
set_target_properties(
81+
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llobasic.a
82+
)
83+
elseif (BLE_LIB_TYPE STREQUAL "BLE_LIB_FULL")
84+
set_target_properties(
85+
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llo.a
86+
)
87+
endif()
6288

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

6692
if(CONFIG_SOC_STM32WBA65XX)
6793
message(STATUS "STM32WBA6 link layer lib selected")
68-
set(LL_LIB "WBA6_LinkLayer_BLE_Full_lib.a")
94+
if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
95+
set(LL_LIB "WBA6_LinkLayer_BLE_Basic_lib.a")
96+
elseif (BLE_LIB_TYPE STREQUAL "BLE_LIB_FULL")
97+
set(LL_LIB "WBA6_LinkLayer_BLE_Full_lib.a")
98+
endif()
6999
endif()
70100

71101
if(CONFIG_SOC_STM32WBA55XX OR SOC_STM32WBA52XX)
72102
message(STATUS "STM32WBA5 link layer lib selected")
73-
set(LL_LIB "LinkLayer_BLE_Full_lib.a")
103+
if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
104+
set(LL_LIB "LinkLayer_BLE_Basic_lib.a")
105+
elseif (BLE_LIB_TYPE STREQUAL "BLE_LIB_FULL")
106+
set(LL_LIB "LinkLayer_BLE_Full_lib.a")
107+
endif()
74108
endif()
75109

76110
# Using the selected version of link layer lib

zephyr/module.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,41 @@ blobs:
1111
license-path: zephyr/blobs/stm32wba/lib/license.md
1212
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
1313
description: "Binary Link Layer library for the STM32WBA6 Bluetooth subsystem"
14+
- path: stm32wba/lib/WBA6_LinkLayer_BLE_Basic_lib.a
15+
sha256: aefc7ce2360d12bac52ff38741fcd40cfb0fecf4eff657b2d32b2986dd4165e2
16+
type: lib
17+
version: '1.6.0'
18+
license-path: zephyr/blobs/stm32wba/lib/license.md
19+
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
20+
description: "Binary Link Layer library for the STM32WBA6 Bluetooth subsystem"
1421
- path: stm32wba/lib/LinkLayer_BLE_Full_lib.a
1522
sha256: c935072ee0d98ddaec3b7f4a1e502ade9768c3fe8056101823a3f19327a1b148
1623
type: lib
1724
version: '1.6.0'
1825
license-path: zephyr/blobs/stm32wba/lib/license.md
1926
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
2027
description: "Binary Link Layer library for the STM32WBA5 Bluetooth subsystem"
28+
- path: stm32wba/lib/LinkLayer_BLE_Basic_lib.a
29+
sha256: 6a028bba47a11e96d7a63b906d2f1c3c2c5b2d8b0227859f94803c746a1d74b0
30+
type: lib
31+
version: '1.6.0'
32+
license-path: zephyr/blobs/stm32wba/lib/license.md
33+
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
34+
description: "Binary Link Layer library for the STM32WBA5 Bluetooth subsystem"
2135
- path: stm32wba/lib/stm32wba_ble_stack_llo.a
2236
sha256: 70c881f8492ba712c658ab2c4682b60d62bf14d3d55822a611702b32b286c9b1
2337
type: lib
2438
version: '1.6.0'
2539
license-path: zephyr/blobs/stm32wba/lib/license.md
2640
url: https://github.com/STMicroelectronics/STM32CubeWBA/raw/v1.6.0/Middlewares/ST/STM32_WPAN/ble/stack/lib/stm32wba_ble_stack_llo.a
2741
description: "Binary Stack library for the STM32WBA Bluetooth subsystem"
42+
- path: stm32wba/lib/stm32wba_ble_stack_llobasic.a
43+
sha256: e4008830f7d3284a8e2634e80120e4f5fb145ec0fdbfa96a0be0b4363b605411
44+
type: lib
45+
version: '1.6.0'
46+
license-path: zephyr/blobs/stm32wba/lib/license.md
47+
url: https://github.com/STMicroelectronics/STM32CubeWBA/raw/v1.6.0/Middlewares/ST/STM32_WPAN/ble/stack/lib/stm32wba_ble_stack_llobasic.a
48+
description: "Binary Stack library for the STM32WBA Bluetooth subsystem"
2849
- path: stm32wb0/lib/stm32wb0x_ble_stack_controller_only.a
2950
sha256: 54bf69acaa59afc368132f8170e9910858a2c801538494d8de96fa567c02e233
3051
type: lib

0 commit comments

Comments
 (0)