Skip to content

Commit b2da8aa

Browse files
committed
feat(diag): pass serial port to esp-idf-diag
If a port is specified for the idf.py command, pass it to esp-idf-diag. This ensures that the esptools used for gathering target information connect to the explicitly specified port rather than relying on autodetection. Signed-off-by: Frantisek Hrbata <[email protected]>
1 parent a225749 commit b2da8aa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/idf_py_actions/diag_ext.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ def add_recipe_arguments(diag_args: list) -> None:
100100
diag_args += ['--force']
101101
if purge_file:
102102
diag_args += ['--purge', purge_file]
103+
if args.port:
104+
diag_args += ['--port', args.port]
105+
else:
106+
yellow_print( ( 'The target serial port is not specified, so '
107+
'autodetection will be used. To set it manually, use '
108+
'the "--port" option. Example: "idf.py --port '
109+
'/dev/ttyUSB0 diag".'))
103110

104111
try:
105112
RunTool('idf_diag', diag_args, args.project_dir, hints=not args.no_hints)()

0 commit comments

Comments
 (0)