Skip to content

Commit

Permalink
fix: Fixed glitches on RTS line when no_reset option on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-kocka committed Jan 25, 2024
1 parent 4c2e113 commit 956557b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 11 additions & 1 deletion esptool/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,17 @@ def __init__(self, port=DEFAULT_PORT, baud=ESP_ROM_BAUD, trace_enabled=False):

if isinstance(port, str):
try:
self._port = serial.serial_for_url(port, exclusive=True)
self._port = serial.serial_for_url(
port, exclusive=True, do_not_open=True
)
if sys.platform == "win32":
# When opening a port on Windows,
# the RTS/DTR (active low) lines
# need to be set to False (pulled high)
# to avoid unwanted chip reset
self._port.rts = False
self._port.dtr = False
self._port.open()
except serial.serialutil.SerialException as e:
port_issues = [
[ # does not exist error
Expand Down
3 changes: 0 additions & 3 deletions test/test_esptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,6 @@ def test_short_flash_to_external_ROM(self):
self.verify_readback(0, 1024, "images/one_kb.bin", spi_connection=self.conn)


@pytest.mark.skipif(
os.name == "nt", reason="Temporarily disabled on windows"
) # TODO: ESPTOOL-673
class TestStubReuse(EsptoolTestCase):
def test_stub_reuse_with_synchronization(self):
"""Keep the flasher stub running and reuse it the next time."""
Expand Down

0 comments on commit 956557b

Please sign in to comment.