3939 + "tl_dbg_conf.h" ,
4040]
4141
42- ble_heartrate_app_path = "Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate"
43-
42+ ble_transparent_mode_app_path = "Projects/NUCLEO-WBA55CG/Applications/BLE/" \
43+ + "BLE_TransparentMode"
4444file_list_wba = {
45- "auto" : ["Middlewares/ST/STM32_WPAN/ble/stack/include/auto/ble_types.h" ,
46- ],
47- "reg_files" : ["Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/_40nm_reg_files/"
48- + "DWC_ble154combo.h" ,
49- ],
50- "ll" : ["Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/bsp.h" ,
51- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/common_types.h" ,
52- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/event_manager.h" ,
53- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/evnt_schdlr_gnrc_if.h" ,
54- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/hci.h" ,
55- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ll_intf.h" ,
56- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/mem_intf.h" ,
57- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/os_wrapper.h" ,
58- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/power_table.h" ,
59- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/pta.h" ,
60- "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/ble_full/"
61- + "ll_fw_config.h" ,
62- ],
63- "hci" : ["Middlewares/ST/STM32_WPAN/ble/stack/include/ble_bufsize.h" ,
64- "Middlewares/ST/STM32_WPAN/ble/stack/include/ble_const.h" ,
65- "Middlewares/ST/STM32_WPAN/ble/stack/include/ble_defs.h" ,
66- "Middlewares/ST/STM32_WPAN/ble/stack/include/ble_std.h" ,
67- "Middlewares/ST/STM32_WPAN/ble/stack/include/bleplat.h" ,
68- "Middlewares/ST/STM32_WPAN/ble/stack/include/blestack.h" ,
69- "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/linklayer_plat.h" ,
70- "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/ll_sys.h" ,
71- "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_cs.c" ,
72- "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_dp_slp.c" ,
73- "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_intf.c" ,
74- "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_startup.c" ,
75- "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/ll_sys_startup.h" ,
76- "Middlewares/ST/STM32_WPAN/stm32_wpan_common.h" ,
77- "Middlewares/ST/STM32_WPAN/ll_intf_cmn.h" ,
78- ble_heartrate_app_path + "/Core/Inc/app_common.h" ,
79- ble_heartrate_app_path + "/Core/Inc/app_conf.h" ,
80- ble_heartrate_app_path + "/Core/Inc/app_entry.h" ,
81- ble_heartrate_app_path + "/Core/Inc/utilities_conf.h" ,
82- ble_heartrate_app_path + "/Core/Inc/main.h" ,
83- ble_heartrate_app_path + "/System/Modules/Flash/rf_timing_synchro.c" ,
84- ble_heartrate_app_path + "/System/Modules/Flash/rf_timing_synchro.h" ,
85- ble_heartrate_app_path + "/System/Modules/Flash/flash_driver.c" ,
86- ble_heartrate_app_path + "/System/Modules/Flash/flash_driver.h" ,
87- ble_heartrate_app_path + "/System/Modules/Flash/flash_manager.c" ,
88- ble_heartrate_app_path + "/System/Modules/Flash/flash_manager.h" ,
89- ble_heartrate_app_path + "/System/Modules/RTDebug/debug_signals.h" ,
90- ble_heartrate_app_path + "/System/Modules/RTDebug/RTDebug.c" ,
91- ble_heartrate_app_path + "/System/Modules/RTDebug/RTDebug.h" ,
92- ble_heartrate_app_path + "/System/Modules/RTDebug/local_debug_tables.h" ,
93- ble_heartrate_app_path + "/System/Modules/scm.c" ,
94- ble_heartrate_app_path + "/System/Modules/scm.h" ,
95- ble_heartrate_app_path + "/System/Modules/stm_list.c" ,
96- ble_heartrate_app_path + "/System/Modules/stm_list.h" ,
97- ble_heartrate_app_path + "/System/Modules/utilities_common.h" ,
98- ble_heartrate_app_path + "/System/Interfaces/hw.h" ,
99- ble_heartrate_app_path + "/System/Interfaces/hw_aes.c" ,
100- ble_heartrate_app_path + "/System/Interfaces/hw_if.h" ,
101- ble_heartrate_app_path + "/System/Interfaces/hw_pka.c" ,
102- ble_heartrate_app_path + "/System/Interfaces/pka_p256.c" ,
103- ble_heartrate_app_path + "/System/Config/Log/log_module.c" ,
104- ble_heartrate_app_path + "/System/Config/Log/log_module.h" ,
105- ble_heartrate_app_path + "/System/Config/Debug_GPIO/app_debug.h" ,
106- ble_heartrate_app_path + "/System/Config/Debug_GPIO/debug_config.h" ,
107- ble_heartrate_app_path + "/STM32_WPAN/Target/power_table.c" ,
108- ble_heartrate_app_path + "/STM32_WPAN/Target/bpka.c" ,
109- ble_heartrate_app_path + "/STM32_WPAN/Target/bpka.h" ,
110- ble_heartrate_app_path + "/STM32_WPAN/Target/linklayer_plat.c" ,
111- ble_heartrate_app_path + "/STM32_WPAN/Target/ll_sys_if.c" ,
112- "Utilities/trace/adv_trace/stm32_adv_trace.h" ,
113- "Utilities/misc/stm32_mem.h" ,
114- "Utilities/tim_serv/stm32_timer.h" ,
115- "Utilities/misc/stm32_tiny_vsnprintf.h" ,
116- ],
45+ "STM32_WPAN" : [
46+ "Middlewares/ST/STM32_WPAN/ble/stack/include/auto/ble_types.h" ,
47+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/_40nm_reg_files/"
48+ + "DWC_ble154combo.h" ,
49+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/bsp.h" ,
50+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/common_types.h" ,
51+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/event_manager.h" ,
52+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/evnt_schdlr_gnrc_if.h" ,
53+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/hci.h" ,
54+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ll_intf.h" ,
55+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ll_intf_cmn.h" ,
56+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/mem_intf.h" ,
57+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/os_wrapper.h" ,
58+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/power_table.h" ,
59+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/pta.h" ,
60+ "Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/ble_full/"
61+ + "ll_fw_config.h" ,
62+ "Middlewares/ST/STM32_WPAN/ble/stack/include/ble_bufsize.h" ,
63+ "Middlewares/ST/STM32_WPAN/ble/stack/include/ble_const.h" ,
64+ "Middlewares/ST/STM32_WPAN/ble/stack/include/ble_defs.h" ,
65+ "Middlewares/ST/STM32_WPAN/ble/stack/include/ble_std.h" ,
66+ "Middlewares/ST/STM32_WPAN/ble/stack/include/bleplat.h" ,
67+ "Middlewares/ST/STM32_WPAN/ble/stack/include/blestack.h" ,
68+ "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/linklayer_plat.h" ,
69+ "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/ll_sys.h" ,
70+ "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_cs.c" ,
71+ "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_dp_slp.c" ,
72+ "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_intf.c" ,
73+ "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_startup.c" ,
74+ "Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/ll_sys_startup.h" ,
75+ "Middlewares/ST/STM32_WPAN/stm32_wpan_common.h" ,
76+ ],
77+ "BLE_TransparentMode" : [
78+ ble_transparent_mode_app_path + "/Core/Inc/app_common.h" ,
79+ ble_transparent_mode_app_path + "/Core/Inc/app_conf.h" ,
80+ ble_transparent_mode_app_path + "/Core/Inc/app_entry.h" ,
81+ ble_transparent_mode_app_path + "/Core/Inc/utilities_conf.h" ,
82+ ble_transparent_mode_app_path + "/Core/Inc/main.h" ,
83+ ble_transparent_mode_app_path + "/System/Modules/Flash/rf_timing_synchro.c" ,
84+ ble_transparent_mode_app_path + "/System/Modules/Flash/rf_timing_synchro.h" ,
85+ ble_transparent_mode_app_path + "/System/Modules/Flash/flash_driver.c" ,
86+ ble_transparent_mode_app_path + "/System/Modules/Flash/flash_driver.h" ,
87+ ble_transparent_mode_app_path + "/System/Modules/Flash/flash_manager.c" ,
88+ ble_transparent_mode_app_path + "/System/Modules/Flash/flash_manager.h" ,
89+ ble_transparent_mode_app_path + "/System/Modules/RTDebug/debug_signals.h" ,
90+ ble_transparent_mode_app_path + "/System/Modules/RTDebug/RTDebug.c" ,
91+ ble_transparent_mode_app_path + "/System/Modules/RTDebug/RTDebug.h" ,
92+ ble_transparent_mode_app_path + "/System/Modules/RTDebug/local_debug_tables.h" ,
93+ ble_transparent_mode_app_path + "/System/Modules/scm.c" ,
94+ ble_transparent_mode_app_path + "/System/Modules/scm.h" ,
95+ ble_transparent_mode_app_path + "/System/Modules/stm_list.c" ,
96+ ble_transparent_mode_app_path + "/System/Modules/stm_list.h" ,
97+ ble_transparent_mode_app_path + "/System/Modules/utilities_common.h" ,
98+ ble_transparent_mode_app_path + "/System/Interfaces/hw.h" ,
99+ ble_transparent_mode_app_path + "/System/Interfaces/hw_aes.c" ,
100+ ble_transparent_mode_app_path + "/System/Interfaces/hw_if.h" ,
101+ ble_transparent_mode_app_path + "/System/Interfaces/hw_pka.c" ,
102+ ble_transparent_mode_app_path + "/System/Interfaces/pka_p256.c" ,
103+ ble_transparent_mode_app_path + "/System/Config/Log/log_module.c" ,
104+ ble_transparent_mode_app_path + "/System/Config/Log/log_module.h" ,
105+ ble_transparent_mode_app_path + "/System/Config/Debug_GPIO/app_debug.h" ,
106+ ble_transparent_mode_app_path + "/System/Config/Debug_GPIO/debug_config.h" ,
107+ ble_transparent_mode_app_path + "/STM32_WPAN/Target/power_table.c" ,
108+ ble_transparent_mode_app_path + "/STM32_WPAN/Target/bpka.c" ,
109+ ble_transparent_mode_app_path + "/STM32_WPAN/Target/bpka.h" ,
110+ ble_transparent_mode_app_path + "/STM32_WPAN/Target/linklayer_plat.c" ,
111+ ble_transparent_mode_app_path + "/STM32_WPAN/Target/ll_sys_if.c" ,
112+ ],
113+ "Utilities" : [
114+ "Utilities/trace/adv_trace/stm32_adv_trace.h" ,
115+ "Utilities/misc/stm32_mem.h" ,
116+ "Utilities/tim_serv/stm32_timer.h" ,
117+ "Utilities/misc/stm32_tiny_vsnprintf.h" ,
118+ ],
117119}
118120
119121
@@ -140,54 +142,53 @@ def os_cmd(cmd, cwd=None, shell=False):
140142
141143def copy_hci_files (src_repo_path , dest_lib_path , stm32_serie ):
142144 """Copy sources files from Cube Firmware to zephyr"""
143- # remove existing *.c and *.h files
144- hci_path = Path (dest_lib_path / "hci" )
145- if hci_path .exists ():
146- for item in os .listdir (hci_path ):
147- if item .endswith (".c" ) or item .endswith (".h" ):
148- os .remove (hci_path / item )
149-
150145 if stm32_serie == "stm32wb" :
146+ # Remove existing *.c and *.h files
147+ hci_path = Path (dest_lib_path / "hci" )
148+ if hci_path .exists ():
149+ for item in os .listdir (hci_path ):
150+ if item .endswith (".c" ) or item .endswith (".h" ):
151+ os .remove (hci_path / item )
152+
153+ # Create hci folder if does not exist
151154 if not hci_path .exists ():
152155 hci_path .mkdir (parents = True )
153156
157+ # Copy files
154158 for file in file_list_wb :
155- file_path = Path (src_repo_path / file )
156- file_name = file_path .name
157- if file_path .exists ():
159+ src_file_path = Path (src_repo_path / file )
160+ file_name = src_file_path .name
161+ if src_file_path .exists ():
158162 # copy each file to destination
159- shutil .copy (file_path , Path (hci_path / file_name ))
163+ shutil .copy (src_file_path , Path (hci_path / file_name ))
160164 else :
161- logging .error (f"File : { file_path } not found" )
165+ logging .error (f"File : { src_file_path } not found" )
162166 logging .error ("Abort" )
163167 sys .exit ()
164168
165169 elif stm32_serie == "stm32wba" :
166- # remove existing *.c and *.h files
167- auto_path = Path (hci_path / "auto" )
168- ll_path = Path (hci_path / "ll" )
169- reg_files_path = Path (ll_path / "_40nm_reg_files" )
170- dir_paths = {"hci" : hci_path , "auto" : auto_path , "ll" : ll_path ,
171- "reg_files" : reg_files_path }
172-
173- for dir_path in [auto_path , ll_path , reg_files_path ]:
174- if dir_path .exists ():
175- for item in os .listdir (dir_path ):
176- if item .endswith (".c" ) or item .endswith (".h" ):
177- os .remove (dir_path / item )
170+ # Remove existing *.c and *.h files
171+ for root , _ , files in os .walk (dest_lib_path ):
172+ for file in files :
173+ if file .endswith (".c" ) or file .endswith (".h" ):
174+ os .remove (os .path .join (root , file ))
178175
179176 for dir_name in file_list_wba :
180- if not dir_paths [dir_name ].exists ():
181- dir_paths [dir_name ].mkdir (parents = True )
182-
183177 for file in file_list_wba [dir_name ]:
184- file_path = Path (src_repo_path / file )
185- file_name = file_path .name
186- if file_path .exists ():
187- # copy each file to destination
188- shutil .copy (file_path , Path (dir_paths [dir_name ]))
178+ # Src file path to be copied
179+ src_file_path = Path (src_repo_path / file )
180+ if src_file_path .exists ():
181+ # Extract the relevant part of the path from "dir_name" onwards
182+ start_index = file .find (dir_name )
183+ relative_path = file [start_index :]
184+ # Create the full destination path
185+ destination_path = os .path .join (dest_lib_path , relative_path )
186+ # Create (if does not exist) all directories in the destination path
187+ os .makedirs (os .path .dirname (destination_path ), exist_ok = True )
188+ # Copy the file to the destination path
189+ shutil .copy (src_file_path , destination_path )
189190 else :
190- logging .error (f"File : { file_path } not found" )
191+ logging .error (f"File : { src_file_path } not found" )
191192 logging .error ("Abort" )
192193 sys .exit ()
193194
0 commit comments