Building for ESP32 takes quite long (looks like it does a rebuild of all libs etc. everytime)

Hi,

I'm currently working on a ESP32 (AI Thinker ESP32-CAM) and using Arduino IDE 1.8.19.

So far everything is working well, except building the project. Even if I only changed one little thing in the ino file, it is rebuilding all the libs etc. what takes a lot of time.

Is there an option to switch of rebuilding and only build changed files?

Thank you!

Take a look at Compilation time Arduino IDE
I found that for a esp3266 it did not rebuild everything (I didn't have an esp32 to try).

Yes, there is a way to build only changed files. You can open the “Preferences” option in the “File” menu and then enable “Show verbose output during compilation”. Now when you compile the sketch, the output will show which files are being compiled. If you change a file and compile the sketch again, only the changed files should be recompiled.

I hope that helps. Let me know if you have any further questions.

Have fun with your project!

Note that it only saves the precompiled code within an IDE session. The data is saved in a temp folder (that you can find in the messages). If you close the IDE and restart a new temp folder is generated and everything recompiled.

In the earlier IDEs (decade ago?) the object files were kept in the sketch folder so the precompiled modules for a sketch were kept across the restart of the IDE. No idea when or why it was changed.

My impression (I've not actually measured this) is that it is more likely to preserve parts after one successful build within a session.

I already changed the preferences to show the rebuilded files, what makes me know, that it builds a lot of not changed Files.

I use an external Editor. Might that bei the reason?

Can you try with a very simple sketch, say the blink sketch, and compile that.
Afterwards, make one tiny change (say in the delay times) and compile again.
See if there is a noticeable difference in the build times.

I have used an ESP32 recently and it definitely saves build components after one successful build.

I'm not sure about the impact of an external editor.

Yes, that could be the reason why it doesn't work!

This is true for Arduino IDE 1.x, but not for Arduino IDE 2.x. The compilation cache is persistent when using Arduino IDE 2.x. Starting from Arduino IDE 2.0.4, the IDE will delete compilation caches that haven't been used in the last 30 days (arduino/arduino-cli#2033). Your operating system may also clean the temporary folder where the caches are stored.

Please post the output:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the box next to "Show verbose output during: ☐ compilation".
  3. Click the OK button.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to finish.
  6. Click on the black console panel at the bottom of the Arduino IDE window.
  7. Press Ctrl+A to select all the text.
  8. Press Ctrl+C.
    This will copy the selected text to the clipboard.
  9. Open a forum reply here by clicking the Reply button.
  10. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the compilation output is correctly formatted.
    Code tags icon on toolbar
  11. Press Ctrl+V.
    This will paste the compilation output into the code block.
  12. Move the cursor outside of the code tags before you add any additional text to your reply.
  13. Click the Reply button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the Reply button.
  5. Click the "Upload" icon (image) on the post composer toolbar:
    Upload icon on toolbar
  6. Select the .txt file you saved.
  7. Click the Open button.
  8. Click the Reply button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.