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 <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2025-06-11 16:52:18 +02:00
parent a2257490d2
commit b2da8aae45

View File

@@ -100,6 +100,13 @@ def diag(action: str,
diag_args += ['--force']
if purge_file:
diag_args += ['--purge', purge_file]
if args.port:
diag_args += ['--port', args.port]
else:
yellow_print( ( 'The target serial port is not specified, so '
'autodetection will be used. To set it manually, use '
'the "--port" option. Example: "idf.py --port '
'/dev/ttyUSB0 diag".'))
try:
RunTool('idf_diag', diag_args, args.project_dir, hints=not args.no_hints)()