When I first compile a sketch it takes 5-10minutes. I have to sit through this as I need to press the boot button to load the sketch when compiling is finished. (The sketches I’m compiling are simple ie blink etc.)

It takes slightly less time on future compiles but is still 2-3minutes.

You are watching: Why does arduino take so long to compile

On my Arduino Mega sketches are compiled in well under a minute.

Is this several minutes normal?


*
Steve Mercer answered 11 months ago

It’s somewhat dependent on the speed of your computer but this is my experience too. From what I see it compiles all the libraries (Including ESP32 Core) every time. I believe with the ESP32 having things like WiFi, Bluetooth, SD Card etc that it just takes longer than other Arduino’s that don’t have those. Also, I think the Arduino IDE only uses one core of your processor.

You may like to try PlatformIO. It caches whatever it has already compiled so subsequent compiles are very snappy. It also appears to make use of all cores available so is faster on initial compile too.

These are my observations. I don’t know whether it’s all actually correct.

Also you may like to get yourself a board that does not require pushing a button. Two of my boards (Heltec WiFi Kit 32 and Arducam IOTAI) will upload and run without the button push.


1Vote UpVote Down
*
Sara Santos Staff answered 11 months ago

Hi Jim.It is normal for the ESP32 to take a little more time to compile than the Arduino.However, 5 to 10 minutes is a lot of time. As Steve mentioned it may be related to the speed of your computer.You may also try Steve’s suggestion and see if using PlatformIO is faster than Arduino IDE.Here’s a tutorial on how to get started: https://randomnerdtutorials.com/vs-code-platformio-ide-esp32-esp8266-arduino/Regards,Sara


0Vote UpVote Down
*
Sara Santos Staff answered 11 months ago

As for the boot button, you may take a look at this “solution”: https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/Regards,Sara


0Vote UpVote Down
*
Jim Roberts answered 11 months ago

Thanks for that.I’ve done a bit of messing around today and found, through my Task Manager, that there is an IBM Trusteer Rapport program (which is required by online banking) that uses lots of resources during the compile (no idea why). If I shut this down the compile time drops to Still not brilliant but I can live with this.Even more liveable with if I use one of the boards you suggest which don’t need the boot button pressing,


0Vote UpVote Down
*
Sara Santos Staff answered 11 months ago

Hi Jim.I also think that some antivirus slow down the compilation time. But, I’m not sure if that’s your case.Regards,Sara


0Vote UpVote Down
*
Jim Roberts answered 11 months ago

Thanks for answers Sara, lots to look into here.

See more: What Would You Do If We Were Stuck In A Box ? Template Meme Generator


Primary Sidebar


Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.Login »


Latest Course Updates


You must be logged in to view this content.