mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 06:34:34 +02:00
tools: fix unnecessary port detection for multiple targets
When multiple targets are specified, e.g. idf.py flash monitor, the automatic port detection is performed twice. Keep the port value in args.port and avoid multiple calls to get_default_serial_port(). Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import json
|
||||
import os
|
||||
@@ -149,11 +149,11 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
|
||||
coredump_to_flash = coredump_to_flash_config.rstrip().endswith('y') if coredump_to_flash_config else False
|
||||
|
||||
prog = os.path.join(project_desc['build_dir'], project_desc['app_elf'])
|
||||
esp_port = args.port or get_default_serial_port()
|
||||
args.port = args.port or get_default_serial_port()
|
||||
|
||||
espcoredump_kwargs = dict()
|
||||
|
||||
espcoredump_kwargs['port'] = esp_port
|
||||
espcoredump_kwargs['port'] = args.port
|
||||
espcoredump_kwargs['baud'] = args.baud
|
||||
espcoredump_kwargs['gdb_timeout_sec'] = gdb_timeout_sec
|
||||
|
||||
|
@@ -95,8 +95,8 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
|
||||
yellow_print(msg)
|
||||
no_reset = False
|
||||
|
||||
esp_port = args.port or get_default_serial_port()
|
||||
monitor_args += ['-p', esp_port]
|
||||
args.port = args.port or get_default_serial_port()
|
||||
monitor_args += ['-p', args.port]
|
||||
|
||||
baud = monitor_baud or os.getenv('IDF_MONITOR_BAUD') or os.getenv('MONITORBAUD')
|
||||
|
||||
@@ -163,8 +163,8 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
|
||||
yellow_print('skipping flash since running on linux...')
|
||||
return
|
||||
|
||||
esp_port = args.port or get_default_serial_port()
|
||||
run_target(action, args, {'ESPBAUD': str(args.baud), 'ESPPORT': esp_port})
|
||||
args.port = args.port or get_default_serial_port()
|
||||
run_target(action, args, {'ESPBAUD': str(args.baud), 'ESPPORT': args.port})
|
||||
|
||||
def erase_flash(action: str, ctx: click.core.Context, args: PropertyDict) -> None:
|
||||
ensure_build_directory(args, ctx.info_name)
|
||||
|
Reference in New Issue
Block a user