mpremote: Improve ESPxx board detection and user configuration. #17800
+54
−7
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
With modern ESPxxx boards switching to native USB , and less reliance on 3rd party UART drivers I think it is a good time to implement a better detection if a device is likely to have an MCU of the ESP32 or ESP8266 femilies
This PR adds:
when connecting to a decices port on Windows - mpremote can check if it needs ESP-Handling - and then act accordingly
if / when needed new vids/pids can be added to the default list via PRs, and included in the next release
personal / interim changes can be done by editing the mpremote config file.
In this draft the detection is based on a list of 4-tuples,
Current implementation only used the VID and PID to identify ,
the vendor could be used if if there is a need to extend matches.
The list of VIDs and PIDs has been gathered through
user configuration:
the user configuration allows to add additional PID/VIDs.
currently overriding the built-in list is not implemented
Testing
Manual testing can be done by attaching devices and running the following script:
Positive identification of:
not detected as ESPxx device.
Trade-offs and Alternatives
VID/PID versus Vendor name
Up to now the determination was done just based on the Vendor name.
See #9659
Cherry-picking
This PR contains a few cherry-picked commits from other PRs that are required to allow this PR to work.
They should be automatically dropped when this PR is rebased before merging.
Signed-off-by: Jos Verlinde Jos_Verlinde@hotmail.com