Repository navigation
mpremote: fix esp usb reset - #17776
Merged
Merged
Conversation
|
Code size report: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17776 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22283 22283
=======================================
Hits 21924 21924
Misses 359 359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
projectgus
approved these changes
Jul 30, 2025
projectgus
left a comment
Contributor
There was a problem hiding this comment.
I don't have a Windows setup to easily verify the fix but this seems very reasonable, thanks @Josverl!
dpgeorge
approved these changes
Aug 1, 2025
Detection of ESP-XX devices was based on just the names of the USB driver name, and did not account for the switch of the newer ESP-xx devices to USB-CDC. On Windows this caused unwanted/unneeded resets as the DTR/RTS signals are also used for automatic device reset over USB-CDC. See #9659 (comment) This commit uses the Espressif registered VID 0x303A to detect USB-CDC ports, to enable the same DTR/RTS settings as used on the UART-USB connection. Also improved the robustness of the code using `getattr()`. Signed-off-by: Jos Verlinde <[email protected]>
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Detection of ESP-XX devices was based on just the names of the USB driver name.
and did not account for the switch of the newer ESP-xx devices to USB-CDC.
On Windows this caused unwanted/unneeded resets as the DTR/RTS signals are also used for automatic device reset over USB-CDC as reported by @crackwitz in #9659 (comment).
This PR uses the Espressif registered VID : 0x303A to detect USB-CDC ports ,
to enable the same DTR/RTS settings as used on the UART-USB connection.
Also improved the robustness of the code using
getattr()Depends on : #17775
Testing
Manual testing on Windows and WSL2
Trade-offs and Alternatives
Detection of the ESPxx devices via the USB-CDC VID is more deterministic than
getattr(portinfo[0], "manufacturer", "") != "Microsoft", and will cover most of not all Espressif boards.One possible drawback is that if/when other board manufacturers register their own VIDs for devices powered by an ESP32 - and access over USB-CDC that they will be exposed to unexpected resets.