Skip to content

Refactor port selection after 1200bps touch upload #8218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Nov 21, 2018

New behaviour:
if upload failed or we are uploading through a "Programming" port (that does not disappear), leave the user selected port selected.
if upload succeded and we are using 1200bps touch, wait for the first port that reappears, and if nothing reappears after the timeout select the bootloader port.

Fixes #3495

New behaviour:
if upload failed or we are uploading through a "Programming" port (that does not disappear), leave the user selected port selected.
if upload succeded and we are using 1200bps touch, wait for the first port that reappears, and if nothing reappears after the timeout select the bootloader port.

Fixes #arduino#3495
@matthijskooijman
Copy link
Collaborator

I haven't looked at the code in detail, but can't we match the port based on the USB identifier (I mean the connection path / USB port, not the vidpid).

@facchinm
Copy link
Member Author

Matching on the usb identifier would be THE BEST; I tried that approach once with libusb hotplug but it didn't really work 🙂 Anyway, any help on this would be greatly appreciated.

@PilotinControl25
Copy link

Ok so this build works under windows Vista by pressing the reset button and it uploads....any way of not doing that each time?

@facchinm
Copy link
Member Author

@PilotinControl25 which board are you targeting?

@PilotinControl25
Copy link

I am using the Mell Bell Pico arduino compatible board which they are using the Leonardo style board. However each time i plug the board in it gets assigned a different port. I tried assigning the port number via device manager and still does not work. Only with this style board. My other boards do not change ports. The fix does not work. I am using windows vista.

@facchinm
Copy link
Member Author

Thanks @PilotinControl25 for testing. Would you mind sharing a screencast of an upload? Or even the verbose output could be enough to try to replicate the issue

@facchinm
Copy link
Member Author

I've been able to reproduce the original problem on WIndows XP by switching between a sketch with #include "Mouse.h" and one without.
I confirm that this patch solves this kind of issue.
If the board changes port number after every download it should just behave in the same way unless the driver takes longer than 5 seconds to load (it's a problem on its own, but not something we can solve I believe)

@cmaglie
Copy link
Member

cmaglie commented Nov 27, 2018

The fix looks good, it should cover new cases without touching the existing one. I'm merging this one so it may get broader testing on the hourly build.

@cmaglie cmaglie merged commit ffba05f into arduino:master Nov 27, 2018
@cmaglie cmaglie deleted the select_right_port_after_touch_upload branch November 27, 2018 16:06
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.

5 participants