Upload only option?

Is there a way to rapidly upload sketch that has been compiled?
Getting the ESP32 booting process timed right is a big pain.
Bo W4GHV since '54

I moved your topic to an appropriate forum category @bobarry.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

Hi @bobarry.

There isn't any way to do this using Arduino IDE. However, you can do it by using a different development tool provided by Arduino, which is targeted to this type of more advanced use case. This tool is named Arduino CLI. It is a command line tool:

https://arduino.github.io/arduino-cli/latest/

When using Arduino CLI, we can upload the previously compiled sketch file by running the arduino-cli upload command:

https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_upload/

When you are using this command, it is important to remember you are uploading the binary that was produced from the sketch code as it was the last time you compiled the sketch. Any changes you made to the code since the last time you compiled will not be present in the program that is uploaded.


Alternatively, you can use the board's upload tool (esptool for 3rd party boards, or dfu-util if you are using the Nano ESP32) directly.

Arduino IDE just runs this tool during an upload so you can determine the correct command to run by studying the output Arduino IDE produces during an upload when you have verbose output enabled in your Arduino IDE preferences:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compile in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
    The "Preferences" dialog will close.
  5. Perform an upload, as usual.
  6. Wait for the upload to finish.

Now study the contents of the black "Output" panel at the bottom of the Arduino IDE window. You might need to scroll it up to find the relevant part of the output, but somewhere in there you will see the command Arduino IDE ran to upload the sketch. You can copy the command line from the output and then run it directly from the command line anytime you want to upload the sketch.

Note that the binary file to be uploaded is stored in a temporary folder that is dedicated to that specific sketch. So you do need to make sure to use the correct path in the command for the sketch you want to upload. This is a bit less tricky when using Arduino CLI because you only need to run the Arduino CLI command from the sketch folder (or else pass the path of the sketch to the command as an argument and Arduino CLI automatically determines where to find the binary file. As an alternative approach, you can use Sketch > Export Compiled Binary in Arduino IDE to compile the sketch instead of the normal method of clicking the "Verify/Compile" button. This will cause the binary file to be saved under the sketch folder, which will be a bit easier of a location to use in your upload tool command lines.

THANKS a lot. Great solutions. Bo W4GHV

You are welcome. I'm glad if I was able to be of assistance.

Regards,
Per