mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
Merge branch 'bugfix/esptool_autodetection' into 'master'
bugfix: Fix port autodetection with esptool package See merge request espressif/esp-idf!17944
This commit is contained in:
@@ -26,10 +26,8 @@ def action_extensions(base_actions, project_path):
|
|||||||
def _get_default_serial_port(args):
|
def _get_default_serial_port(args):
|
||||||
# Import is done here in order to move it after the check_environment() ensured that pyserial has been installed
|
# Import is done here in order to move it after the check_environment() ensured that pyserial has been installed
|
||||||
try:
|
try:
|
||||||
import serial.tools.list_ports
|
|
||||||
esptool_path = os.path.join(os.environ['IDF_PATH'], 'components/esptool_py/esptool/')
|
|
||||||
sys.path.insert(0, esptool_path)
|
|
||||||
import esptool
|
import esptool
|
||||||
|
import serial.tools.list_ports
|
||||||
ports = list(sorted(p.device for p in serial.tools.list_ports.comports()))
|
ports = list(sorted(p.device for p in serial.tools.list_ports.comports()))
|
||||||
# high baud rate could cause the failure of creation of the connection
|
# high baud rate could cause the failure of creation of the connection
|
||||||
esp = esptool.get_default_connected_device(serial_list=ports, port=None, connect_attempts=4,
|
esp = esptool.get_default_connected_device(serial_list=ports, port=None, connect_attempts=4,
|
||||||
|
Reference in New Issue
Block a user