Skip to content

Commit b983bbf

Browse files
committed
scripts: support WB0 wireless libraries update
Add wireless library update from STM32CubeWB0. Factorize use of ble_library.update() for the 3 series (wb, wba, wb0) in serie_update.py script for sakee of simplicity. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
1 parent e790e59 commit b983bbf

File tree

2 files changed

+90
-20
lines changed

2 files changed

+90
-20
lines changed

scripts/ble_library.py

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,79 @@
145145
],
146146
}
147147

148+
wb0_ble_transparent_mode_app_path = "Projects/NUCLEO-WB09KE/Applications/BLE/" \
149+
+ "BLE_TransparentMode"
150+
151+
file_list_wb0 = {
152+
"STM32_BLE": [
153+
"Middlewares/ST/STM32_BLE/ble.h",
154+
"Middlewares/ST/STM32_BLE/stack/config/ble_stack_user_cfg.c",
155+
"Middlewares/ST/STM32_BLE/stack/include/ble_api.h",
156+
"Middlewares/ST/STM32_BLE/stack/include/ble_const.h",
157+
"Middlewares/ST/STM32_BLE/stack/include/ble_events.h",
158+
"Middlewares/ST/STM32_BLE/stack/include/ble_gatt.h",
159+
"Middlewares/ST/STM32_BLE/stack/include/bleplat_cntr.h",
160+
"Middlewares/ST/STM32_BLE/stack/include/bleplat.h",
161+
"Middlewares/ST/STM32_BLE/stack/include/ble_stack.h",
162+
"Middlewares/ST/STM32_BLE/stack/include/ble_stack_user_cfg.h",
163+
"Middlewares/ST/STM32_BLE/stack/include/ble_status.h",
164+
"Middlewares/ST/STM32_BLE/stack/include/ble_types.h",
165+
"Middlewares/ST/STM32_BLE/stack/include/uuid.h",
166+
],
167+
"BLE_TransparentMode": [
168+
wb0_ble_transparent_mode_app_path + "/Core/Inc/app_common.h",
169+
wb0_ble_transparent_mode_app_path + "/Core/Inc/app_conf.h",
170+
wb0_ble_transparent_mode_app_path + "/Core/Src/stm32wb0x_hal_msp.c",
171+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/aci_adv_nwk.c",
172+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/aci_adv_nwk.h",
173+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/aci_gatt_nwk.h",
174+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/aci_l2cap_nwk.h",
175+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/adv_buff_alloc.c",
176+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/adv_buff_alloc.h",
177+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/adv_buff_alloc_tiny.c",
178+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/adv_buff_alloc_tiny.h",
179+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/app_ble.h",
180+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/ble_conf.h",
181+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dm_alloc.c",
182+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dm_alloc.h",
183+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dtm_burst.h",
184+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dtm_cmd_db.c",
185+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dtm_cmd_db.h",
186+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dtm_cmd_en.h",
187+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dtm_cmds.c",
188+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dtm_cmd_stack_en.h",
189+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dtm_preprocess_events.c",
190+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/dtm_preprocess_events.h",
191+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/fifo.h",
192+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/hci_parser.h",
193+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/pawr_buff_alloc.c",
194+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/pawr_buff_alloc.h",
195+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/transport_layer.c",
196+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/App/transport_layer.h",
197+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/Target/bleplat.c",
198+
wb0_ble_transparent_mode_app_path + "/STM32_BLE/Target/bleplat_cntr.c",
199+
],
200+
"Common": [
201+
"Projects/Common/BLE/Interfaces/hw_aes.c",
202+
"Projects/Common/BLE/Interfaces/hw_aes.h",
203+
"Projects/Common/BLE/Interfaces/hw_pka.c",
204+
"Projects/Common/BLE/Interfaces/hw_pka.h",
205+
"Projects/Common/BLE/Interfaces/hw_rng.c",
206+
"Projects/Common/BLE/Interfaces/hw_rng.h",
207+
"Projects/Common/BLE/Modules/asm.h",
208+
"Projects/Common/BLE/Modules/blue_unit_conversion.s",
209+
"Projects/Common/BLE/Modules/compiler.h",
210+
"Projects/Common/BLE/Modules/crash_handler.h",
211+
"Projects/Common/BLE/Modules/miscutil.c",
212+
"Projects/Common/BLE/Modules/miscutil.h",
213+
"Projects/Common/BLE/Modules/osal.h",
214+
"Projects/Common/BLE/Modules/osal_memcpy.s",
215+
"Projects/Common/BLE/Modules/PKAMGR/Inc/pka_manager.h",
216+
"Projects/Common/BLE/Modules/PKAMGR/Src/pka_manager.c",
217+
"Projects/Common/BLE/Modules/RADIO_utils/Inc/RADIO_utils.h",
218+
"Projects/Common/BLE/Modules/RADIO_utils/Src/RADIO_utils.c",
219+
],
220+
}
148221

149222
def os_cmd(cmd, cwd=None, shell=False):
150223
"""Execute a command with subprocess.check_call()
@@ -193,15 +266,25 @@ def copy_ble_lib_files(src_repo_path, dest_lib_path, stm32_serie):
193266
logging.error("Abort")
194267
sys.exit()
195268

196-
elif stm32_serie == "stm32wba":
269+
elif stm32_serie in ["stm32wba", "stm32wb0"]:
270+
271+
if stm32_serie == "stm32wba":
272+
target_file_list = file_list_wba
273+
elif stm32_serie == "stm32wb0":
274+
target_file_list = file_list_wb0
275+
else:
276+
logging.error(f"File : Unexpected series {stm32_serie}")
277+
logging.error("Abort")
278+
sys.exit()
279+
197280
# Remove existing *.c and *.h files
198281
for root, _, files in os.walk(dest_lib_path):
199282
for file in files:
200283
if file.endswith(".c") or file.endswith(".h"):
201284
os.remove(os.path.join(root, file))
202285

203-
for dir_name in file_list_wba:
204-
for file in file_list_wba[dir_name]:
286+
for dir_name in target_file_list:
287+
for file in target_file_list[dir_name]:
205288
# Src file path to be copied
206289
src_file_path = Path(src_repo_path / file)
207290
if src_file_path.exists():

scripts/serie_update.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,11 @@ def update_stm32_hal_serie(self):
779779
self.apply_zephyr_patch()
780780
self.merge_commit()
781781

782-
# 8) In case of stm32wb, update ble library
783-
if self.stm32_serie == "stm32wb":
782+
# 8) In case of stm32wb/wba/wb0, update library
783+
if self.stm32_serie in ["stm32wb", "stm32wba", "stm32wb0"]:
784784
ble_library.update(
785785
self.stm32cube_serie_path,
786-
Path(self.zephyr_hal_stm32_path / "lib" / "stm32wb"),
786+
Path(self.zephyr_hal_stm32_path / "lib" / self.stm32_serie),
787787
self.stm32cube_temp,
788788
self.current_version,
789789
self.version_update,
@@ -792,19 +792,6 @@ def update_stm32_hal_serie(self):
792792
)
793793
self.merge_commit(lib=True)
794794

795-
# 9) In case of stm32wba, update hci library
796-
elif self.stm32_serie == "stm32wba":
797-
ble_library.update(
798-
self.stm32cube_serie_path,
799-
Path(self.zephyr_hal_stm32_path / "lib" / "stm32wba"),
800-
self.stm32cube_temp,
801-
self.current_version,
802-
self.version_update,
803-
self.update_commit,
804-
self.stm32_serie
805-
)
806-
self.merge_commit(lib=True)
807-
808-
# 10) clean
795+
# 9) clean
809796
self.clean_files()
810797
logging.info("%s", f"Done {self.stm32_serie}\n")

0 commit comments

Comments
 (0)