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 )
115zephyr_include_directories(Common/WPAN/Interfaces)
126zephyr_include_directories(Common/WPAN/Modules)
137zephyr_include_directories(Common/WPAN/Modules/Flash)
148zephyr_include_directories(Common/WPAN/Modules/RTDebug)
159zephyr_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)
2310zephyr_include_directories(Utilities/misc)
2411zephyr_include_directories(Utilities/tim_serv)
2512zephyr_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)
3116zephyr_sources(Common/WPAN/Modules/Log /log_module.c)
3217zephyr_sources(Common/WPAN/Interfaces/hw_pka.c)
3318zephyr_sources(Common/WPAN/Interfaces/hw_pka_p256.c)
3419zephyr_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
4022if (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)
4527endif ()
4628
29+ set (STM32WBA_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR} /../../zephyr/blobs/stm32wba/lib)
30+
31+ # select the type of BLE library
4732if (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" )
6449endif ()
6550
66-
67- set (STM32WBA_BLE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR} /../../zephyr/blobs/stm32wba/lib)
6851set (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
7153add_library (stm32wba_ble_lib STATIC IMPORTED GLOBAL )
72- add_library (stm32wba_ll_lib STATIC IMPORTED GLOBAL )
7354
7455add_dependencies (
7556 stm32wba_ble_lib
7657 stm32wba_ll_lib
7758)
7859if (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 )
8263elseif (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 )
8667endif ()
8768
@@ -90,9 +71,13 @@ if(NOT CONFIG_BT_STM32WBA_USE_TEMP_BASED_CALIB)
9071 zephyr_compile_definitions( -DUSE_TEMPERATURE_BASED_RADIO_CALIBRATION=0 )
9172endif ()
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
9681if (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 ()
11297endif ()
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 } )
117102set_target_properties (stm32wba_ll_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_LL_LIB_INCLUDE_DIR} )
118-
119- target_link_libraries (app PUBLIC stm32wba_ble_lib)
120103target_link_libraries (app PUBLIC stm32wba_ll_lib)
104+
105+ add_subdirectory (STM32_WPAN)
106+
107+ add_subdirectory_ifdef(CONFIG_BT_STM32WBA ble)
0 commit comments