-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Upload & Monitor and Test find wrong serial port for Arduino Leonardo, others #172
Comments
get_test_port() in this file: This function seems to be doing a lot:
I'm not entirely sure what the fix for this should be because at least on classic arduinos with a dedicated serial chip, you can't depend on the USB hardware IDs. At the very least, if |
Error messages on Windows 10upload & monitor with no port configured.notice how it's trying COM5. COM10 is the port it should use
upload & monitor with
|
Error messages on OS X 10.14.6PlatformIO, version 4.1.0b3 leonardo serial should be on /dev/cu.usbmodem141101 Upload & Monitor with no
|
Does classic uploading work as expected? |
Yeah, Upload alone works fine, and Monitor alone works fine, there's just the race condition when trying to do one then quickly do the other on these devices that do software USB serial. I think get_test_port() for example should:
If I were to make a pull request with the changes I propose, which branch should I start from? |
If anybody else has this issue prior to a fix, there is a workaround described here... |
Configuration
Windows 10, also OS X 10.14:
PlatformIO Version (
platformio --version
): PlatformIO, version 4.1.0b3Description of problem
"Upload & Monitor" and "Test" will open the wrong serial port on devices such as the Arduino Leonardo or Adafruit M0 & M4 devices that use a software USB interface that re-enumerates after uploading a new program.
Steps to Reproduce
Actual Results
Depending on configuration upload & monitor or test fail in one of the following ways:
Expected Results
Platformio should wait until the device enumerates again and choose the correct serial port.
If problems with PlatformIO Build System:
The content of
platformio.ini
:Source file to reproduce issue:
src/main.cpp
test/test_main.cpp
Additional info
If I configure monitor_port or test_port then I get the "cannot find file specified" error in windows.
If I don't, then I will get a serial error on upload & monitor because it chooses the leonardo programming serial port which disappears when the leonardo reboots.
Here's some other people probably hitting the same issue:
The text was updated successfully, but these errors were encountered: