Sometimes,
you just want to upload the binary or Hex file to Arduino Zero or MKR_ZERO
board without sharing the code. There are many tutorials how to do that on a
AVR board. But for SAMD MCUs, this is not same. Here is a quick way to do it on
SAMD based Arduino boards,
- Install Arduino IDE (We really don't need this. However, installing Arduino will also install "BOSSAC" which a modified version of BOSSA.)
- Get the BOSSAC.EXE installation location from here,C:\Users\”USER NAME”\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3
- From Arduino IDE, create a Arduino project binary image using “Sketch -> Export Complied Binary”. This should create 2 binary files for this project, one with bootloader and another without bootloader in the project directory
- Connect the Zero board with a USB cable
- Press the reset button of the zero board twice. The on-board yellow led should turn on
- The board should appear as a new com device. Get this com port number from Windows device manager
- Now open command terminal and add this command
C:\Users\”USER NAME”\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3/bossac.exe --port=COM34 -U true -i -e -w -v C:\”Project file location”/”Project binary file”.bin -R
Change the com port number with you device comport and replace the quoted part with your own file location (without quote). Also be careful about the '/' and '\'.
And done!
Now you can share you firmware file with the bossac folder to anyone who dose not need have access the code. Also you can write small script to do it automatically.