Skip to content

Windows: try to fix connection issue#999

Merged
SergioGasquez merged 3 commits intoesp-rs:mainfrom
FantasyTeddy:windows-reset-issue
Feb 4, 2026
Merged

Windows: try to fix connection issue#999
SergioGasquez merged 3 commits intoesp-rs:mainfrom
FantasyTeddy:windows-reset-issue

Conversation

@FantasyTeddy
Copy link
Copy Markdown
Contributor

When trying to connect to my ESP32, I always got the following error:

[2026-02-01T09:20:40Z INFO ] Serial port: 'COM5'
[2026-02-01T09:20:40Z INFO ] Connecting...
Error:   × Error while connecting to device

Previous versions of espflash seem to work just fine.
After some digging (using git bisect) I was able to narrow it down to this commit: d7f800e (#562)
By reverting that commit, everything works fine again.
The changes also align with the reset.py from esptool.

I wonder if that however causes the original issue to reappear? Maybe the work-around mentioned is needed after all?

Copy link
Copy Markdown
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I like the alignment with esptool, sadly, I dont have any way to test things in Windows. Do you mind adding the workaround? I think the current state could bring back the issue in #554

@FantasyTeddy
Copy link
Copy Markdown
Contributor Author

Unfortunately, the Port trait and its underlying COMPort does not offer a way to query the previously set DTR value. Therefore, the same workaround is not possible.

But I tried to add the workaround explicitly to the respective calls of set_rts, which should achieve the same thing.
In fact, if @haileys could test if that actually works (since I don't experience the original issue from #554) we could even try to narrow it down to which call to set_dtr is actually needed.

Additionally, I did not add the workaround to the UsbJtagSerialReset, because I'm not sure if it is actually needed there as well...?

Copy link
Copy Markdown
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, I did not add the workaround to the UsbJtagSerialReset, because I'm not sure if it is actually needed there as well...?

Not sure if its also needed there, maybe we can just leave as is for the moment.

Mind adding a changelog entry?

Copy link
Copy Markdown
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@SergioGasquez SergioGasquez added this pull request to the merge queue Feb 4, 2026
Merged via the queue into esp-rs:main with commit 37ebf3a Feb 4, 2026
32 checks passed
@FantasyTeddy FantasyTeddy deleted the windows-reset-issue branch February 4, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants