I'm a bit slow, but is the reason compile/load is on the menu together because the board to load selection also tells the compiler which board to compile for?
I was always puzzled by compile/load being together...
I'm a bit slow, but is the reason compile/load is on the menu together because the board to load selection also tells the compiler which board to compile for?
I was always puzzled by compile/load being together...
Probably for simplicity. Normally you want to download and test-run every time you compile or re-compile.
I am not sure what you are asking. Do you mean, why is there an option to verify/compile the code as well as an option to upload the code which also verifies and compiles the code ?
To put it another way: what you don't want to do for an Upload is to use an out-of-date binary. Your workflow might be to incrementally add stuff and Verify (compile) periodically to make sure it does that successfully. Then once you want to try it, hit Upload.
If the dependency detection is good enough, then in theory the Upload could see an existing binary, determine that "nothing has changed" since it was created -- the selected board, the libraries, the versions of those, and your sketch code -- and just upload that.
But apparently not, at least not for all cases. It is safer to always recompile before an Upload. And if you're going to do that, you need to know the target board.
The actual upload is also board-specific, although maybe in broader categories. Different tools are invoked to do the upload, like for ESP32 versus AVR for example.
On IDE 2.x, aside from the generic File, Edit, and Help menus, there's only Sketch and Tools. I'd say Verify and Upload would both go under Sketch anyway.
Exactly.
"Compile/verify" is handy to see if there are program errors. Saves time, and you don't need to have any board connected.
however, the processor is reset and restarted even when the compile fails ... which is confusing
I don't see any problem with the current arrangement. I edit compile, edit compile, edit compile, upload (which also compiles all modules). Been doing the for over half a century, can't think of an improvement (well I can but it would be much more complex than you might imagine)
I was thinking that maybe it was so that if the board type was changed (I for example switch between UNO and MEGA) then you are forced to recompile for the board specified before trying to load it.
have you ever spent a few hours trying to figure out why the code doesn't seem to have your latest change?
I haven't actually, not in recent years....
I have spent far more hours on that than the time writing the stupid makefiles would have cost.