Skip to content

Commit 991f73c

Browse files
vtardy-sterwango
authored andcommitted
lib: stm32wba: Update ble folder architecture on STM32WBA
rename ble folder and add/change CMakeList Signed-off-by: Vincent Tardy <[email protected]>
1 parent 76d62ee commit 991f73c

File tree

17 files changed

+57
-38
lines changed

17 files changed

+57
-38
lines changed

lib/stm32wba/CMakeLists.txt

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,22 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
zephyr_compile_definitions( -DBLE )
6-
7-
zephyr_include_directories(BLE_TransparentMode/Core/Inc)
8-
zephyr_include_directories(BLE_TransparentMode/STM32_WPAN/Target)
9-
zephyr_include_directories(BLE_TransparentMode/System/Config/Debug_GPIO)
10-
zephyr_include_directories(BLE_TransparentMode/System/Config/Log)
115
zephyr_include_directories(Common/WPAN/Interfaces)
126
zephyr_include_directories(Common/WPAN/Modules)
137
zephyr_include_directories(Common/WPAN/Modules/Flash)
148
zephyr_include_directories(Common/WPAN/Modules/RTDebug)
159
zephyr_include_directories(Common/WPAN/Modules/Log)
16-
zephyr_include_directories(STM32_WPAN)
17-
zephyr_include_directories(STM32_WPAN/ble/stack/include)
18-
zephyr_include_directories(STM32_WPAN/ble/stack/include/auto)
19-
zephyr_include_directories(STM32_WPAN/link_layer/ll_cmd_lib/config/ble_full)
20-
zephyr_include_directories(STM32_WPAN/link_layer/ll_cmd_lib/inc)
21-
zephyr_include_directories(STM32_WPAN/link_layer/ll_cmd_lib/inc/_40nm_reg_files)
22-
zephyr_include_directories(STM32_WPAN/link_layer/ll_sys/inc)
2310
zephyr_include_directories(Utilities/misc)
2411
zephyr_include_directories(Utilities/tim_serv)
2512
zephyr_include_directories(Utilities/trace/adv_trace)
13+
zephyr_include_directories(STM32_WPAN)
14+
2615

27-
zephyr_sources(BLE_TransparentMode/STM32_WPAN/Target/bpka.c)
28-
zephyr_sources(BLE_TransparentMode/STM32_WPAN/Target/linklayer_plat.c)
29-
zephyr_sources(BLE_TransparentMode/STM32_WPAN/Target/ll_sys_if.c)
30-
zephyr_sources(BLE_TransparentMode/STM32_WPAN/Target/power_table.c)
3116
zephyr_sources(Common/WPAN/Modules/Log/log_module.c)
3217
zephyr_sources(Common/WPAN/Interfaces/hw_pka.c)
3318
zephyr_sources(Common/WPAN/Interfaces/hw_pka_p256.c)
3419
zephyr_sources(Common/WPAN/Modules/RTDebug/RTDebug.c)
35-
zephyr_sources(STM32_WPAN/link_layer/ll_sys/src/ll_sys_cs.c)
36-
zephyr_sources(STM32_WPAN/link_layer/ll_sys/src/ll_sys_dp_slp.c)
37-
zephyr_sources(STM32_WPAN/link_layer/ll_sys/src/ll_sys_intf.c)
38-
zephyr_sources(STM32_WPAN/link_layer/ll_sys/src/ll_sys_startup.c)
20+
3921

4022
if(CONFIG_FLASH)
4123
zephyr_sources(Common/WPAN/Modules/Flash/flash_manager.c)
@@ -44,6 +26,9 @@ if(CONFIG_FLASH)
4426
zephyr_sources(Common/WPAN/Modules/Flash/rf_timing_synchro.c)
4527
endif()
4628

29+
set(STM32WBA_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../zephyr/blobs/stm32wba/lib)
30+
31+
# select the type of BLE library
4732
if (CONFIG_BT_EXT_ADV
4833
OR (CONFIG_BT_PER_ADV OR CONFIG_BT_PER_ADV_SYNC)
4934
OR CONFIG_BT_SCA_UPDATE
@@ -63,25 +48,21 @@ else()
6348
set(BLE_LIB_TYPE "BLE_LIB_BASIC")
6449
endif()
6550

66-
67-
set(STM32WBA_BLE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../zephyr/blobs/stm32wba/lib)
6851
set(STM32WBA_BLE_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/ble/stack)
69-
set(STM32WBA_LL_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/link_layer/ll_cmd_lib)
7052

7153
add_library(stm32wba_ble_lib STATIC IMPORTED GLOBAL)
72-
add_library(stm32wba_ll_lib STATIC IMPORTED GLOBAL)
7354

7455
add_dependencies(
7556
stm32wba_ble_lib
7657
stm32wba_ll_lib
7758
)
7859
if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
7960
set_target_properties(
80-
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llobasic.a
61+
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_LIB_DIR}/stm32wba_ble_stack_llobasic.a
8162
)
8263
elseif (BLE_LIB_TYPE STREQUAL "BLE_LIB_FULL")
8364
set_target_properties(
84-
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llo.a
65+
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_LIB_DIR}/stm32wba_ble_stack_llo.a
8566
)
8667
endif()
8768

@@ -90,9 +71,13 @@ if(NOT CONFIG_BT_STM32WBA_USE_TEMP_BASED_CALIB)
9071
zephyr_compile_definitions( -DUSE_TEMPERATURE_BASED_RADIO_CALIBRATION=0 )
9172
endif()
9273

93-
# Selecting the proper version of link layer lib according the soc
94-
# Checking all the soc variants and not simply relying on board name
74+
# Using the selected version of ble lib
75+
set_target_properties(stm32wba_ble_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_LIB_INCLUDE_DIR})
9576

77+
target_link_libraries(app PUBLIC stm32wba_ble_lib)
78+
79+
# Selecting the proper version of link layer lib
80+
# Checking all the soc variants and not simply relying on board name
9681
if(CONFIG_SOC_STM32WBA65XX)
9782
message(STATUS "STM32WBA6 link layer lib selected")
9883
if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
@@ -111,10 +96,12 @@ if(CONFIG_SOC_STM32WBA55XX OR SOC_STM32WBA52XX)
11196
endif()
11297
endif()
11398

114-
# Using the selected version of link layer lib
115-
set_target_properties(stm32wba_ll_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/${LL_LIB})
116-
set_target_properties(stm32wba_ble_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_LIB_INCLUDE_DIR})
99+
add_library(stm32wba_ll_lib STATIC IMPORTED GLOBAL)
100+
set(STM32WBA_LL_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/link_layer/ll_cmd_lib)
101+
set_target_properties(stm32wba_ll_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_LIB_DIR}/${LL_LIB})
117102
set_target_properties(stm32wba_ll_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_LL_LIB_INCLUDE_DIR})
118-
119-
target_link_libraries(app PUBLIC stm32wba_ble_lib)
120103
target_link_libraries(app PUBLIC stm32wba_ll_lib)
104+
105+
add_subdirectory(STM32_WPAN)
106+
107+
add_subdirectory_ifdef(CONFIG_BT_STM32WBA ble)

lib/stm32wba/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Description:
2222
Middlewares/ST/STM32_WPAN/ble/stack/include/ble_std.h
2323
Middlewares/ST/STM32_WPAN/ble/stack/include/bleplat.h
2424
Middlewares/ST/STM32_WPAN/ble/stack/include/blestack.h
25-
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/_40nm_reg_files/DWC_ble154combo.h
25+
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/_40nm_reg_files/_40nm_reg_files/DWC_ble154combo.h
2626
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/bsp.h
2727
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/common_types.h
2828
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/event_manager.h
@@ -71,7 +71,7 @@ Description:
7171
Projects/Common/WPAN/Modules/Log/log_module.c
7272
Projects/Common/WPAN/Modules/Log/log_module.h
7373
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/System/Config/Debug_GPIO/app_debug.h
74-
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/System/Config/Debug_GPIO/debug_config.h
74+
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/System/Config/Log/log_module_conf.h
7575
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/power_table.c
7676
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/bpka.c
7777
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/bpka.h
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2025 STMicroelectronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
if (CONFIG_BT_STM32WBA)
5+
zephyr_compile_definitions( -DBLE )
6+
endif()
7+
8+
if (CONFIG_BT_STM32WBA)
9+
zephyr_include_directories(ble/stack/include)
10+
zephyr_include_directories(ble/stack/include/auto)
11+
zephyr_include_directories(link_layer/ll_cmd_lib/config/ble_full)
12+
endif()
13+
zephyr_include_directories(inc)
14+
zephyr_include_directories(link_layer/ll_cmd_lib/inc)
15+
zephyr_include_directories(link_layer/ll_cmd_lib/inc/_40nm_reg_files)
16+
zephyr_include_directories(link_layer/ll_sys/inc)
17+
18+
zephyr_sources(link_layer/ll_sys/src/ll_sys_cs.c)
19+
zephyr_sources(link_layer/ll_sys/src/ll_sys_dp_slp.c)
20+
zephyr_sources(link_layer/ll_sys/src/ll_sys_intf.c)
21+
zephyr_sources(link_layer/ll_sys/src/ll_sys_startup.c)

lib/stm32wba/ble/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 STMicroelectronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
zephyr_include_directories(Core/Inc)
5+
zephyr_include_directories(STM32_WPAN/Target)
6+
zephyr_include_directories(System/Config/Debug_GPIO)
7+
zephyr_include_directories(System/Config/Log)
8+
zephyr_sources(STM32_WPAN/Target/bpka.c)
9+
zephyr_sources(STM32_WPAN/Target/linklayer_plat.c)
10+
zephyr_sources(STM32_WPAN/Target/ll_sys_if.c)
11+
zephyr_sources(STM32_WPAN/Target/power_table.c)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)