Long upload times for the SAMD21

I have used the Sparkfun SAMD21 board for many projects. Most of the time, scripts compile and upload very quickly, in seconds. But occasionally, I’ll have a script that goes from uploading in seconds to uploading in minutes - specifically uploads go from 15 seconds to 3 minutes. The issue seems to follow the script. Moving the script to another computer gives the same results, and compiling and uploading a different script on the same computer still uploads in seconds. This has happened on more than one script, but I have yet to figure out what change to a script brings about the dramatic change in upload times.

I have never seen this behavior on the Pro Micro, the other board I use the most Has anyone else seen this behavior with the SAMD21?

Tom

Hello Tom,

When you say ‘script’, are you using the Arduino IDE?

Aside from that, I would agree that it sounds like its something specific in the code. While we can’t directly assist with custom code, I would suggest checking the libraries that included. While I’ve not encountered anything lasting near 3 minutes, large libraries and included files could slow down the compile time. How fast are just the compilation times of your custom code versus a simple program like Blink?

I spent a little more time today looking at this issue…

I am using the Arduino 1.8.10 IDE

I am using the Arduino SAMD Boards 1.8.4

I am using the Sparkfun SAMD Boards 1.7.4

I am not using any libraries in the current script.

When this issue has occurred, it only impact the upload time, not the compile time. Compiles only take seconds.

I just went back and compiled/uploaded several old scripts, and they all are experiencing the extended upload times at this time, including Blink, so this is NOT a script related issue.

Then I tried a different SAMD21 board and breadboard and re-compiled and uploaded the script that was currently in that board, and the upload time was seconds. So I tried compiling/uploading blink, and the upload time was seconds. Back to the original script for that breadboard and still fast.

So put that known “fast” SAMD21 into original “slow” breadboard, compiled and uploaded original script for that breadboard. Fast upload.

Found a third SAMD21 and put that into the “slow” breadboard, compiled and uploaded original script. Slow upload.

Went back and compiled/uploaded Blink into the (now) two “slow” SAMD21’s, both outside breadboards (only connected to USB port) Both are still slow.

I tried the double press reset to reset the SAMD21 before uploading – still slow.

So it looks like this is something that happens to the SAMD21 boards as the problem clearly follows the SAMD21 board. I have now tested two slow SAMD21’s and one fast SAMD21. I know they all started out fast, so something must have gotten damaged while in use to cause this problem. Other than being very slow to upload, the boards appear to function fine after uploading.

Tom