mirror of
https://github.com/espressif/esptool.git
synced 2025-10-16 23:06:31 +08:00
fix: USB-JTAG-Serial PID detection error
This commit is contained in:
@@ -494,12 +494,14 @@ class ESPLoader(object):
|
|||||||
if active_port.startswith("/dev/") and os.path.islink(active_port):
|
if active_port.startswith("/dev/") and os.path.islink(active_port):
|
||||||
active_port = os.path.realpath(active_port)
|
active_port = os.path.realpath(active_port)
|
||||||
|
|
||||||
|
active_ports = [active_port]
|
||||||
|
|
||||||
# The "cu" (call-up) device has to be used for outgoing communication on MacOS
|
# The "cu" (call-up) device has to be used for outgoing communication on MacOS
|
||||||
if sys.platform == "darwin" and "tty" in active_port:
|
if sys.platform == "darwin" and "tty" in active_port:
|
||||||
active_port = [active_port, active_port.replace("tty", "cu")]
|
active_ports.append(active_port.replace("tty", "cu"))
|
||||||
ports = list_ports.comports()
|
ports = list_ports.comports()
|
||||||
for p in ports:
|
for p in ports:
|
||||||
if p.device in active_port:
|
if p.device in active_ports:
|
||||||
return p.pid
|
return p.pid
|
||||||
print(
|
print(
|
||||||
"\nFailed to get PID of a device on {}, "
|
"\nFailed to get PID of a device on {}, "
|
||||||
|
Reference in New Issue
Block a user