Opening Serial Monitor during upload causes it to fail #581
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
topic: serial monitor
Related to the Serial Monitor
type: imperfection
Perceived defect in any part of project
Describe the problem
The Arduino IDE uses the serial ports of Arduino boards in two different ways:
The port can not be used for both of these things simultaneously. The IDE handles the condition of Serial Monitor being open when an upload is started automagically like so:
🐛 It does not currently handle the reverse, where the Serial Monitor is opened while an upload is in progress. This results in a confusing upload failure.
To reproduce
NOTE: because it is timing sensitive, the issue will be difficult to reproduce with a minimal sketch that compiles very quickly, especially on a subsequent compilation when the libraries have already been cached. Use a larger sketch to accurately simulate real world conditions.
The board's port is now opened in Serial Monitor.
🐛 Note that the upload has failed with an error something like:
Expected behavior
Don't allow user to break upload by opening Serial Monitor.
Arduino IDE 1.x allows Serial Monitor to be opened during upload, but it is in a disabled state where the opening of the port is deferred until after the upload finishes, behaving just the same as when an upload is started with Serial Monitor already open:
Arduino IDE version
2.0.0-beta.12-nightly.20211028
Operating system
Windows
Operating system version
10
Additional context
Originally reported at #271 (comment)
Issue checklist
The text was updated successfully, but these errors were encountered: