Arduino Due - Upload speed

Just started using Arduino Due on Atom 1.6.0, PlatformIO-ide 1.1.1 on Macbook Pro OSX 10.11.2 Editing, compiling works well but uploads to the Due seem very slow. They typically take 40s plus.

I have tried to eliminate the bossac verification (if that is the problem or would help) but too no avail. I believe it is in the platform.txt file.

Any other suggestions or thoughts would be appreciated.

Hi @deekers

Looks like it’s normal behaviour for the Due boards.
Does Arduino IDE upload firmware faster?
Have you tried using native USB port and dueUSB board?

As I am new to the Due I am not familiar with the use of the dual USB ports. I haven’t used the
’native port’ but the ‘programming port’ for uploading, serial monitor, etc. I am not sure how to
use the native port yet. (Would I create a new Due project but specify the native port?)

I took a simple sketch that had 7 lines of code. On the Arduino IDE it loaded in a just seconds
On platformIO it was over 34 seconds.

Can I not disable the write verify step? The bossac command line shows–verify but I don’t
know where to remove this.

We pass the same flags to the upload tool as the Arduino IDE does.
Could you please try these two versions bossac-1.5 and bossac-1.6 with your board?
Just replace default package in PlatformIO home directory /home/user/.platformio/packages/tool-bossac

Tried both and the speeds are almost the same. It takes 37.8 seconds. Please note that I cannot review all of the output from the upload as the panel buffer isn’t large enough to hold all the output data.

In other words I can only scroll back so far and the first steps to the upload are not visible. As the text scrolls by it looks like the upload takes 14 seconds and the verification takes up the rest of the time.

It appears as if the verification checks the entire address space and not just the data that was written out though I can’t confirm this.

I would like to turn the verification step off. Where can I do this?

–> Update
On the Arduino IDE the upload output provides the number of pages that is written and verified
which in the test sketch is 60. In PlatformIO the page count is 332.

@deekers I have a Due board… I’ve just re-tested both ports and it works well for me. The flags to bossac tool are the same between Arduino IDE and PlatformIO. Also, I tested PlatformIO IDE & CLI - works cool!

  1. Please check that you have the latest Atom 1.6.2 and all packages are updated (Menu: PlatformIO > Update Atom packages)
  2. Try to upload using PlatformIO CLI. Please open Terminal within PlatformIO IDE and run pio run -t upload.

Atom 1.6.2
All Atom packages are up to date.

Upload with cli: 33.98 seconds
Upload via menu: 33.6 seconds

Upload via Arduino IDE: approx. 13 seconds

I agree it works, its just slow. The flags I agree are the same but I wish someone would answer my
question and let me know where to turn off the -verify flag. I will at least get 15.7 seconds back.

For me it took 9sec. See log

Please go to ~/.atom/packages/platformio-ide/penv/lib/python2.7/site-packages/platformio/builder/scripts/ and comment this line

The main difference in our logs is that yours shows an upload of 46 pages and mine is 296. A factor of 6 difference.
The end of of my upload is:

========================= [SUCCESS] Took 32.94 seconds =========================

Here is the code:

#include <Arduino.h>

void setup() {
// put your setup code here, to run once:

void loop() {
// put your main code here, to run repeatedly:

Why it is so large I don’t know yet.

Could you share somewhere your firmware.hex? It is located in .pioenvs/*/firmware.hex. I’ll try to flash it. Thanks.

I have an .elf and a .bin but no .hex after a build.

@deekers Could you please share your whole project (with .pioenv directory) as .zip somewhere?

Here is a google cloud link to entire directory.

I see that our final binaries are not the same on the same Mac OS. Could you clean up PlatformIO’s packages using rm -rf ~/.platformio and start a build process again?

The size of my firmware is 11.8Kb where yours is 75.7Kb :scream:

Did the rm -rf ~/.platformio.

Restored project from google drive.

Restarted atom, packages reloaded, the bin file is 76KB in size.

I’ve just invited you to PlatfromIO Club. Please contact directly with me for the private support for the FREE.