Skip to content
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" also does a build/verify #2103

Closed
3 tasks done
marcusobrien opened this issue Jun 17, 2023 · 2 comments
Closed
3 tasks done

"Upload" also does a build/verify #2103

marcusobrien opened this issue Jun 17, 2023 · 2 comments
Assignees
Labels
conclusion: invalid Issue/PR not valid topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@marcusobrien
Copy link

Describe the problem

There are 6 sketch build and upload buttons in the Arduino 2 IDE.

Toolbar Verify Button - Builds the sketch
Toolbar Upload Button - Builds the sketch, then uploads to device

Menu Bar Sketch Menu - Verify/Compile MenuButton - Builds the sketch
Menu Bar Sketch Menu - Upload MenuButton - Builds the sketch and then uploads to device
Menu Bar Sketch Menu - Configure and Upload MenuButton - ??
Menu Bar Sketch Menu - Upload Using Programmer MenuButton - Builds the sketch and then uploads to device

  1. Why does Upload build/verify before uploading ? Can't it just upload the existing binary to the device if there is one already ?
  2. Whats the difference between the Upload Button, Upload MenuButton, Upload using Programmer and COnfigure and Upload ?
  3. How can I upload just an existing binary to the device, without any compilation/build/link/config etc, My workflow is sometimes develop, test - compile and upload, experiment with the device causing firmware wipe, then I want to only re-apply/upload the same firmware that I built earlier, I dont weant to rebuilod anything.

To reproduce

  1. Create a simple project and sketch .ino
  2. Configure IDE for ESP32 for example (can be any device AFAIK)
  3. Press Upload (Right Arrow) on Toolbar - IDE will build the sketch first and then upload firmware binary
  4. Press Upload (Right Arrow) on Toolbar - IDE will build the sketch AGAIN (even without any code changes being made), and then it will upload the newly built firmware binary

Expected behavior

  1. Create a simple project and sketch .ino
  2. Configure IDE for ESP32 for example (can be any device AFAIK)
  3. Press Upload (Right Arrow) on Toolbar - IDE will build the sketch first and then upload firmware binary
  4. Press Upload (Right Arrow) on Toolbar - IDE will NOT build the sketch AGAIN - it will just upload the existing firmware binary

Arduino IDE version

2.1.0

Operating system

Windows

Operating system version

10

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@marcusobrien marcusobrien added the type: imperfection Perceived defect in any part of project label Jun 17, 2023
@per1234 per1234 self-assigned this Jun 18, 2023
@per1234
Copy link
Contributor

per1234 commented Jun 18, 2023

Hi @marcusobrien. Thanks for taking the time to submit an issue.

Why does Upload build/verify before uploading ?

Because Arduino IDE is designed to be friendly to new users. Having a requirement to manually trigger a separate "Verify" operation after any change to the sketch and sketch dependencies before doing an "Upload" operation would make it significantly less friendly to new users, many of whom would end up being confused after forgetting to do that and uploading a binary that doesn't match their sketch code.

In return, separating the two operations would only benefit users in the relatively rare use case of using Arduino IDE to deploy a sketch to multiple boards of the same model.

Can't it just upload the existing binary to the device if there is one already ?

That binary might be outdated. The build phase of the upload ensures that the binary always matches the current sketch code and its dependencies.

The build system caches the compilation output, so the full sketch program is only compiled the first time and when one of the cached objects has been made outdated by a change to the source. There is work in progress to make these subsequent builds more efficient:

Whats the difference between the Upload Button, Upload MenuButton, Upload using Programmer and COnfigure and Upload ?

Discussion of these subjects is off topic for this issue tracker. I'll be happy to answer your questions if you make a post on Arduino Forum:

https://forum.arduino.cc/c/software/ide-2-x/93

How can I upload just an existing binary to the device, without any compilation/build/link/config etc

You can use Arduino CLI. Unlike Arduino IDE, since Arduino CLI is a tool for advanced users, the arduino-cli upload command does not do a compile, instead requiring that the used has previously generated the binary via an arduino-cli compile command.

Alternatively, you can use the upload tool of your board (e.g., esptool) directly to upload the binary.

Because their command line interface enables use in scripts and automated applications, these tools will be much more appropriate than Arduino IDE in the use case of deploying a binary to multiple of the same model board. We will not add such a capability to Arduino IDE (#333).

If you would like assistance with using Arduino CLI, esptool, etc., you are welcome to post on Arduino Forum.

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2023
@per1234 per1234 changed the title Upload doesnt just upload "Upload" also does a build/verify Jun 18, 2023
@per1234 per1234 added conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself topic: CLI Related to Arduino CLI labels Jun 18, 2023
@marcusobrien
Copy link
Author

marcusobrien commented Jun 23, 2023

Added question to Arduino Forumas requested, even though IMO its excessively pedantic not to just answer it here:

https://forum.arduino.cc/t/in-aide-2-1-how-are-the-4-upload-widgets-different/1140799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants