Fixed an issue when a serial port was not automatically detected if the board has predefined HWIDs

This commit is contained in:
Ivan Kravets
2022-07-09 17:23:38 +03:00
parent ddfe5a6c03
commit 0bd27a36e9
2 changed files with 5 additions and 2 deletions

View File

@ -17,6 +17,7 @@ PlatformIO Core 6
~~~~~~~~~~~~~~~~~~
* Show "TimeoutError" only in the verbose mode when can not find a serial port
* Fixed an issue when a serial port was not automatically detected if the board has predefined HWIDs
6.1.0 (2022-07-06)
~~~~~~~~~~~~~~~~~~

View File

@ -97,9 +97,11 @@ def find_serial_port( # pylint: disable=too-many-arguments
if upload_protocol and upload_protocol.startswith("blackmagic"):
return find_blackmagic_serial_port(prefer_gdb_port, timeout)
port = None
if board_config and board_config.get("build.hwids", []):
return find_board_serial_port(board_config, timeout, verbose)
port = find_known_uart_port(ensure_ready, timeout, verbose)
port = find_board_serial_port(board_config, timeout, verbose)
if not port:
port = find_known_uart_port(ensure_ready, timeout, verbose)
if port:
return port