মঙ্গলবার, ২৫ জানুয়ারী, ২০২২

Upload Arduino Zero or MKR ZERO or SAMD firmware with binary file with USB (No Code sharing)

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,

  1. Install Arduino IDE (We really don't need this. However, installing Arduino will also install "BOSSAC" which a modified version of BOSSA.)
  2. Get the BOSSAC.EXE installation location from here,C:\Users\”USER NAME”\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3
  3. 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
  4. Connect the Zero board with a USB cable
  5. Press the reset button of the zero board twice. The on-board yellow led should turn on
  6. The board should appear as a new com device. Get this com port number from Windows device manager
  7.  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.

কোন মন্তব্য নেই:

এই ব্লগটি সন্ধান করুন