Skip to content

Commit fc66564

Browse files
ZhaoxiangJinmmahadevan108
authored andcommitted
hal: mcux-sdk-ng: Update sync script
No longer need to sync files under boards folder, remove the code from the script. Signed-off-by: Zhaoxiang Jin <[email protected]>
1 parent 8e6f89e commit fc66564

File tree

1 file changed

+3
-165
lines changed

1 file changed

+3
-165
lines changed

mcux/scripts/sync_sdk_ng.py

Lines changed: 3 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def copy_filtered_files(src_dir, dest_dir, file_pattern="*", dir_ignore_func=Non
5151

5252
shutil.copy2(src_file, dest_file)
5353

54-
# 特定模块的拷贝函数
5554
def copy_arch(src_sdk, dest_root):
5655
print("Copying arch...")
5756
arch_dirs = {
@@ -85,8 +84,7 @@ def copy_drivers(src_sdk, dest_root):
8584
if not os.path.exists(src_dir):
8685
print(f" Warning: Drivers source not found - {src_dir}")
8786
return
88-
89-
# 文件忽略规则
87+
9088
def ignore_file(filename, _):
9189
return filename.endswith('template') or filename == 'template.readme'
9290

@@ -159,165 +157,6 @@ def copy_cmake_extension(src_sdk, dest_root):
159157
else:
160158
print(f" Warning: CMake file not found - {src_file}")
161159

162-
def copy_boards(src_sdk, dest_root):
163-
print("Copying boards...")
164-
board_map = [
165-
{
166-
"src_path": "evkbimxrt1050",
167-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
168-
"files": ["dcd.c", "dcd.h"],
169-
"dirs": ["xip"],
170-
"dest": "evkbimxrt1050"
171-
},
172-
{
173-
"src_path": "evkbmimxrt1060",
174-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
175-
"files": ["dcd.c", "dcd.h"],
176-
"dirs": ["xip"],
177-
"dest": "evkbmimxrt1060"
178-
},
179-
{
180-
"src_path": "evkbmimxrt1170",
181-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
182-
"files": ["dcd.c", "dcd.h", "xmcd.c", "xmcd.h"],
183-
"dirs": ["xip"],
184-
"dest": "evkbmimxrt1170"
185-
},
186-
{
187-
"src_path": "evkcmimxrt1060",
188-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
189-
"dirs": ["xip"],
190-
"dest": "evkcmimxrt1060"
191-
},
192-
{
193-
"src_path": "evkmimxrt595",
194-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
195-
"dirs": ["flash_config"],
196-
"dest": "evkmimxrt595"
197-
},
198-
{
199-
"src_path": "evkmimxrt685",
200-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
201-
"dirs": ["flash_config"],
202-
"dest": "evkmimxrt685"
203-
},
204-
{
205-
"src_path": "evkmimxrt1010",
206-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
207-
"dirs": ["xip"],
208-
"dest": "evkmimxrt1010"
209-
},
210-
{
211-
"src_path": "evkmimxrt1015",
212-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
213-
"dirs": ["xip"],
214-
"dest": "evkmimxrt1015"
215-
},
216-
{
217-
"src_path": "evkmimxrt1020",
218-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
219-
"files": ["dcd.c", "dcd.h"],
220-
"dirs": ["xip"],
221-
"dest": "evkmimxrt1020"
222-
},
223-
{
224-
"src_path": "evkmimxrt1024",
225-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
226-
"files": ["dcd.c", "dcd.h"],
227-
"dirs": ["xip"],
228-
"dest": "evkmimxrt1024"
229-
},
230-
{
231-
"src_path": "evkmimxrt1040",
232-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
233-
"files": ["dcd.c", "dcd.h"],
234-
"dirs": ["xip"],
235-
"dest": "evkmimxrt1040"
236-
},
237-
{
238-
"src_path": "evkmimxrt1060",
239-
"src_dir": os.path.join(src_sdk, "examples_int", "_boards"),
240-
"files": ["dcd.c", "dcd.h"],
241-
"dirs": ["xip"],
242-
"dest": "evkmimxrt1060"
243-
},
244-
{
245-
"src_path": "evkmimxrt1064",
246-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
247-
"files": ["dcd.c", "dcd.h"],
248-
"dirs": ["xip"],
249-
"dest": "evkmimxrt1064"
250-
},
251-
{
252-
"src_path": "evkmimxrt1160",
253-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
254-
"files": ["dcd.c", "dcd.h"],
255-
"dirs": ["xip"],
256-
"dest": "evkmimxrt1160"
257-
},
258-
{
259-
"src_path": "evkmimxrt1170",
260-
"src_dir": os.path.join(src_sdk, "examples_int", "_boards"),
261-
"files": ["dcd.c", "dcd.h", "xmcd.c", "xmcd.h"],
262-
"dirs": ["xip"],
263-
"dest": "evkmimxrt1170"
264-
},
265-
{
266-
"src_path": "evkmimxrt1180",
267-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
268-
"dirs": ["xip", "jlinkscript"],
269-
"dest": "evkmimxrt1180"
270-
},
271-
{
272-
"src_path": "frdmmcxn947",
273-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
274-
"dirs": ["xip"],
275-
"dest": "frdmmcxn947"
276-
},
277-
{
278-
"src_path": "mcxn9xxevk",
279-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
280-
"dirs": ["xip"],
281-
"dest": "mcxn9xxevk"
282-
},
283-
{
284-
"src_path": "mimxrt700evk",
285-
"src_dir": os.path.join(src_sdk, "examples", "_boards"),
286-
"dirs": ["flash_config"],
287-
"dest": "mimxrt700evk"
288-
},
289-
]
290-
291-
boards_dir = os.path.join(dest_root, 'boards')
292-
os.makedirs(boards_dir, exist_ok=True)
293-
294-
for board_info in board_map:
295-
base_src = board_info['src_dir']
296-
src_path = os.path.join(base_src, board_info['src_path'])
297-
dest_path = os.path.join(boards_dir, board_info['dest'])
298-
299-
if not os.path.exists(src_path):
300-
print(f" Warning: Board source not found - {src_path}")
301-
continue
302-
303-
os.makedirs(dest_path, exist_ok=True)
304-
305-
for file in board_info.get('files', []):
306-
src_file = os.path.join(src_path, file)
307-
if os.path.isfile(src_file) and is_non_empty_file(src_file):
308-
dest_file = os.path.join(dest_path, file)
309-
shutil.copy2(src_file, dest_file)
310-
else:
311-
print(f" Warning: Board file not found - {src_file}")
312-
313-
for dir in board_info.get('dirs', []):
314-
src_dir = os.path.join(src_path, dir)
315-
dest_dir = os.path.join(dest_path, dir)
316-
if os.path.isdir(src_dir):
317-
copy_filtered_files(src_dir, dest_dir, skip_empty=True)
318-
else:
319-
print(f" Warning: Board directory not found - {src_dir}")
320-
321160
def copy_device_family(family, src_sdk, dest_root):
322161
print(f"Copying devices: {family}...")
323162
src_dir = os.path.join(src_sdk, 'devices', family)
@@ -364,7 +203,7 @@ def main():
364203
parser = argparse.ArgumentParser(description='MCUx SDK SYNC TOOL')
365204
parser.add_argument('--mcuxsdk_dir', required=True, help='mcux sdk source dir')
366205
parser.add_argument('--copy_module', nargs='*', choices=[
367-
'arch', 'drivers', 'boards', 'components',
206+
'arch', 'drivers', 'components',
368207
'middleware/usb', 'devices/arch', 'devices/i.MX',
369208
'devices/Kinetis', 'devices/LPC', 'devices/MCX',
370209
'devices/RT', 'devices/Wireless', 'cmake_extension'
@@ -377,7 +216,7 @@ def main():
377216
os.makedirs(dest_root, exist_ok=True)
378217

379218
all_modules = [
380-
'arch', 'drivers', 'boards', 'components',
219+
'arch', 'drivers', 'components',
381220
'middleware/usb', 'devices/arch', 'devices/i.MX',
382221
'devices/Kinetis', 'devices/LPC', 'devices/MCX',
383222
'devices/RT', 'devices/Wireless', 'cmake_extension'
@@ -389,7 +228,6 @@ def main():
389228
module_actions = {
390229
'arch': copy_arch,
391230
'drivers': copy_drivers,
392-
'boards': copy_boards,
393231
'components': copy_components,
394232
'middleware/usb': copy_middleware_usb,
395233
'cmake_extension': copy_cmake_extension,

0 commit comments

Comments
 (0)