I have made a custom-development hardware for our school, where you can plug in an Arduino Due. It is mainly for driving all kind of motors and reading sensor signals. Therefore I added a custom SAM board into board.h based on a copy of the Arduino Due. Furthermore I need a global PWM frequency on all PWM Channels of 20 kHz. So I also changed the variants.h file.

(I have not found a solution that is setting all the underling Timer/Counters for PWM on the Due Pins 2, 3, 4, 5, 6, 7, 8, 13 to 20 kHz by user code, I think this is only possible with the variants.h file - because some timers can not be reset after they where set within the Arduino IDE once)

The Question now: Today all students have to find and modify their variants.h file, which can be located almost anywhere! (Sometimes it is located in the support packages of Matlab...).

Is there an easy solution to give the students one .zip containing the Arduino IDE already with the custom Board included? There is the Arduino IDE working without installation for download on the Arduino website. But how can I add my custom SAM board to it?

  • "I have made a custom arduino board". Please edit your question to explain exactly what you mean by that. Did you just add a new board definition to the Arduino SAM Boards boards.txt file or did you create a complete hardware package? "give them one Zip with everything included". Please edit your question to explain what you mean by "everything". Does that mean the Arduino IDE and the custom Due hardware definition or the custom hardware definition only?
    – per1234
    Oct 27, 2017 at 23:18
  • thanks for the hints. Is the question more clear now?
    – Chris
    Oct 28, 2017 at 9:48
  • The part about what you mean by the .zip file is clear but you forgot to answer my first question.
    – per1234
    Oct 28, 2017 at 11:14
  • I think I did it :)
    – Chris
    Oct 28, 2017 at 11:26
  • It's still not very clear. I'm going to assume that you mean you added a new entry to the Arduino SAM Boards boards.txt file rather than creating a complete hardware package and my answer reflects this assumption. If this is not the case then I will need to modify my answer somewhat.
    – per1234
    Oct 28, 2017 at 11:41

1 Answer 1

  1. Exit the Arduino IDE.
  2. Create a folder in the Arduino IDE installation folder named portable. This will cause the Arduino IDE to run in portable mode.
  3. Start the Arduino IDE.
  4. Tools > Board > Boards Manager
  5. Wait for the download to finish.
  6. Click on "Arduino SAM Boards".
  7. Click "Install".
  8. Wait for installation to finish.
  9. Make your modifications to the Arduino SAM Boards hardware package installed at {Arduino IDE installation folder}/portable/packages/arduino/hardware/sam.
  10. If necessary, configure File > Preferences to your liking.
  11. Exit the Arduino IDE.
  12. Zip the Arduino IDE installation folder.

When you run the Arduino IDE in portable mode it causes hardware packages installed via Boards Manager to be installed to the portable folder, rather than a folder outside the Arduino IDE installation folder. It also stores preferences.txt in the portable folder. This means you can supply a .zip file that contains a copy of the Arduino IDE with the customized Arduino SAM Boards package already installed.

By default it will also set the sketchbook folder to be there but that can be changed via File > Preferences > Sketchbook location if you like.

  • this is exactly what I was looking for! Thanks a lot!
    – Chris
    Oct 28, 2017 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.