3

I would like to know what is the procedure for adding a custom board to the Arduino IDE?

My custom board is similar to the Arduino Zero. Instead of using the ATSAMD21G18, my board is based around the ATSAMC21G18. I also have the Atmel/Microchip SAMC21 Xplained development board.

I have found some open source code where the author has adapted/forked the Arduino SAMD21 code and made it work for the SAMC21 Xplained board (here). The author has stuck to the Arduino hardware folder structure and has added the SAMC21 Xplained to the board.txt file.

As a test, when I install the Arduino SAMD21 from the Arduino Board Manager, I noticed that it installed the hardware files in the following directory:

 %LOCALAPPDATA%\Arduino15\packages\arduino\hardware\samd\1.6.19\

I have read that to add hardware files to the board manager I need to create a .json file with the appropriate details. More information here. However, as far as I can tell, this requires me to zip the SAMC21 hardware files into a tarball and provide a URL to that tarball. I also need to generate and insert a SHA in the .json file.

Am I on the right path with the .json file?

Or should I just download the SAMC21 hardware files and place them in the %LOCALAPPDATA%\Arduino15\packages\arduino\hardware\samd\ folder next to the 1.6.19 folder?

My last resort would be to just copy the files into the existing SAMD21 hardware folder?


I have looked into the following Arduino SE questions but they do not answer the question satisfactorily.

  • I think the .json file is just for publishing so the board manager can find it; you can edit boards.txt to add your own based on zero if its just for you. – esoterik Jul 16 '18 at 20:26
  • do you want to publish it or only for your use? for your use it is simpler to add it into hardware subfolder of your sketches folder – Juraj Jan 15 at 8:05
  • @Juraj This would be just for my own use but I would need to replicate it on a couple of machines. I would appreciate if people could add answers for both scenarios. – sa_leinad Jan 15 at 8:35
  • @Juraj Thanks. I will look into the link shortly. – sa_leinad Jan 15 at 8:35
3
+200

The simplest clean way to add your board using an existing core is to add the variant to your sketches folder's hardware subfolder. Only boards.txt and files for the board variant are added.

In your sketches folder create a 'hardware' folder. In this folder create a folder with the name of your boards package and a subfolder with the architecture name and a subfolder for variant and a name of the variant. for example hardware/my_boards/samd/variants/samc21x

In your variant folder (variants/samc21x) put the files for your variant based on variant files of the closet variant in the referenced hardware package. In your case perhaps a mkrzero would be a good example.

In your package's root (hardware/my_boards/samd/) add boards.txt file with entries for your board.

For boards.txt take the options for a similar board in referenced package. Change the names and settings and prefix build.core value with the name of the vendor of the referenced package. For arduino/samd it would be arduino:. For example samc21x.build.core=arduino:arduino

My custom and customized boards definitions https://github.com/jandrassy/my_boards

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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