Upload a hex file to an <<Arduino DUE>>

Hello,

My Arduino code will be implemented to many Arduinos DUE card, and I'm looking for a tool to upload the hex file directly on each Arduino without compiling everytime, I found Xloader.exe and AVRDUDE.exe but they don't work with this type of Arduinos.

I will be too thankful if someone can help me fixing this.

Thank you

Maybe you can use an Atmel ACE programmer (for AVR and SAM boards).

  1. compile .bin via Arduino IDE (select correct board) -> you will get two files: one with bootloader, one without bootloader
  2. use Atmel Studio 7 / Microchip Studio to upload via ICE Programmer
1 Like

Hi @zackar. The tool used to upload compiled binaries to the Due is named "bossac".

The versions of bossac used by Arduino for the Due are available from these download links:

{
  "name": "bossac",
  "version": "1.5-arduino",
  "systems": [
    {
      "host": "arm-linux-gnueabihf",
      "url": "http://downloads.arduino.cc/bossac-1.5-arduino2-arm-linux-gnueabihf.tar.bz2",
      "archiveFileName": "bossac-1.5-arduino2-arm-linux-gnueabihf.tar.bz2",
      "checksum": "SHA-256:7b61b7814e5b57bcbd853439fc9cd3e98af4abfdd369bf039c6917f9599e44b9",
      "size": "199550"
    },
    {
      "host": "i686-mingw32",
      "url": "http://downloads.arduino.cc/bossac-1.5-arduino2-mingw32.tar.gz",
      "archiveFileName": "bossac-1.5-arduino2-mingw32.tar.gz",
      "checksum": "SHA-256:9d849a34f0b26c25c6a8c4d741cd749dea238cade73b57a3048f248c431d9cc9",
      "size": "222283"
    },
    {
      "host": "x86_64-apple-darwin",
      "url": "http://downloads.arduino.cc/bossac-1.5-arduino2-i386-apple-darwin14.3.0.tar.gz",
      "archiveFileName": "bossac-1.5-arduino2-i386-apple-darwin14.3.0.tar.gz",
      "checksum": "SHA-256:8f07e50a1f887cb254092034c6a4482d73209568cd83cb624d6625d66794f607",
      "size": "64120"
    },
    {
      "host": "x86_64-pc-linux-gnu",
      "url": "http://downloads.arduino.cc/bossac-1.5-arduino2-x86_64-linux-gnu.tar.gz",
      "archiveFileName": "bossac-1.5-arduino2-x86_64-linux-gnu.tar.gz",
      "checksum": "SHA-256:42785329155dcb39872d4d30a2a9d31e0f0ce3ae7e34a3ed3d840cbc909c4657",
      "size": "30431"
    },
    {
      "host": "i686-pc-linux-gnu",
      "url": "http://downloads.arduino.cc/bossac-1.5-arduino2-i486-linux-gnu.tar.gz",
      "archiveFileName": "bossac-1.5-arduino2-i486-linux-gnu.tar.gz",
      "checksum": "SHA-256:ac56e553bbd6d992fa5592ace90996806230ab582f2bf9f8590836fec9dabef6",
      "size": "29783"
    }
  ]
},

(I didn't bother to extract them out of the JSON data format they happen to be in, but you should be able to find them.

The official version of BOSSA is here:

https://www.shumatech.com/web/products/bossa

"bossac" is the command line tool. They also provide a GUI tool.

and Arduino's fork here:


Try this:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the checkbox next to Show verbose output during: ☐ upload.
  3. Click the OK button.
  4. Upload any sketch to your Due.
  5. Wait for the upload process to finish.

Now check the contents of the black output panel at the bottom of the Arduino IDE window (you might need to scroll up to see it all). Here, you will see a command that looks something like this:

"C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino/bossac.exe" -i -d --port=COM11 -U false -e -w  -b "C:\Users\per\AppData\Local\Temp\arduino-sketch-2E5C65403DD7742EF8C89DBAFDB1A5CB/sketch_sep13a.ino.bin" -R

This is the bossac command that was used for the upload.

Unfortunately, running this command from the command line won't result in a successful upload. The reason is because the Arduino IDE first sends a special signal to the board by quickly opening and then closing a serial port connection at 1200 baud. That signal tells the board to prepare to receive an upload. This "1200 bps touch" signal is not produced by bossac, but instead by the IDE.

For this reason, you might find that it is actually more convenient to use Arduino CLI instead of bossac directly:

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

Alternatively, you could create your own bespoke program to produce this "1200 bps touch" signal before running the bossac command.

1 Like

Hi @freesprung,

thank you so much for your response.

I find a solution by using bossac.exe with commande line and its work quiet good, the next step now is to find a bossac GUI that recognizes Arduino DUE (GUI from bossa website does not work) matter of making work easier for my colleagues.

Hi @ptillisch ,

Thank you so much for your response.

Fortunately, i tried the command on the windows command line and its work quite good.

Now i should look for a bossac.exe with GUI matter of making work easier.

Then definitely check out BOSSA:

https://www.shumatech.com/web/products/bossa

Yes I tried to use bossa GUI, but it can't make connexion with my Arduino, there is something that I missed but I don't know what it is.

image

Are you able to upload to COM22 using bossac from the command line?

Yes
image

Unfortunately I don't know a lot about this subject. I do know that Arduino has made some modifications to the version of bossac you are using in that command when compared to the official version of BOSSA you get from the ShumaTech website.

There is also a good chance that the official version of BOSSA is newer than the version used by Arduino.

You can take a look at Arduino's fork of BOSSA to see if you can glean any information there:

Okay great, until now I'm doing well with the command line at least.

I'll come back to you if I succeed to make the same with the BOSSA version (With GUI).

Thank you for your help :smiley:

1 Like

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