-
-
Notifications
You must be signed in to change notification settings - Fork 431
Close serial port connection before flashing firmware #688
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
Conversation
This PR fixes the issue (you can flash the firmware when the serial monitor/plotter is open), but a little problem remains: when you flash the firmware to a board, the sketch on the board is replaced with the code necessary to do the update, so re-opening the serial port is pretty much pointless. I wonder if this impacts the experience |
I don't think so. The reason is that if I am working with the Serial Monitor before doing a firmware update, I am likely to want to go back to working with Serial Monitor again after. So it is convenient for Serial Monitor to remain open, even though there will be no output until I have uploaded my sketch again. The firmware updater already displays a warning about the sketch being overwritten, so the user shouldn't be surprised to find that no output is arriving in the Serial Monitor. However, they would find it confusing to see the "Not connected" banner persist in Serial Monitor after finishing a firmware update, since that could give the impression that something is wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes #684 for me. Thanks @AlbyIanna!
`${firmware.module}@${firmware.firmware_version}`, | ||
]); | ||
this.serialService.uploadInProgress = true; | ||
await this.serialService.disconnect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, you can move this into the try
block. If disconnect
fails, the IDE won't stuck in the uploadInProgress
state. What do you think? Just a proposal, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! Thanks, @kittaakos!
6e286c1
to
c3792b3
Compare
Fixes #684