Open
Description
The IDE allows users to change the board while compiling.
If the user clicked Upload, after the code is fully compiled for the old board, upload is started using the new board setting and an incompatible HEX file compiled for the old board. For example, code compiled for Arduino Uno can be uploaded to Arduino Due (if a Due is actually connected at the selected serial port).
This problem much easier to reproduce on slower Windows computers, where the compile process takes enough time for the user to change settings while the builder is still running.
Activity
PaulStoffregen commentedon Mar 3, 2017
Perhaps changing the setting could abort compiling?
Or maybe compiling could finish normally, but if settings have changed while compiling, simply don't upload?
per1234 commentedon Mar 3, 2017
You can "brick" an ATmega32U4 based board by starting the upload with Uno, etc. selected in the Tools > Board menu, then changing to the correct board selection before the upload begins. I've actually done this. It was easy enough for me to fix but not so much for a beginner.
I think the best solution would be to upload to the board that was selected when the upload button was pressed, rather than the board that is selected at the time the upload starts.
Another option would be to disable the Tools > Board and custom tools menus until the upload completes.
Avoid board change during compilation/upload
PaulStoffregen commentedon Mar 22, 2017
Opps, sorry, errant clicking on the milestone info.
facchinm commentedon Mar 22, 2017
No prob 😉
PaulStoffregen commentedon Mar 22, 2017
Looks like you're getting ready to release 1.8.2, right?
55 remaining items