Rationale
If you have built a custom SAMD-based board, you need to create and flash a bootloader, then make sure the board is supported in Arduino IDE. Doing it properly takes quite some time (especially if you are doing it first time) - you need to understand config files used to build the bootloader, install gcc toolchain for ARM, read Arduino platform specifications, etc.
If you are making a board just for yourself, you can cheat and reuse bootloader and board support package from another board, e.g. one of Adafruit's SAMD-based boards. But this is inconvenient - what if you want to use different pins for second I2C bus? And having your board show up as FEATHERBOOT doesn't feel right, not to mention that reusing Adafruit's USB Vendor ID is technically speaking illegal. And if you are making a board for sale, e.g. on Tindie, then cheating like this is not an option.
Solution
Fortunately, most of the process above can be automated. Once you have learned the proper formats and specifications, you can just write a script that takes in a simple, human-friendly conifg file, processes it and does the rest. This project aims to do exactly that. It requires you to provide minimal configuration data, then it will do the rest: build the bootloader, create an Arduino board support package meeting all specifications, and even create the necessary index.json file for you, allowing anyone to install this package.
Prerequisites
To make it work, you need the following installed on your computer:
- Arduino IDE (version 1.8.0 or later)
- Board support package for Adafruit's SAMD based boards installed in arduino IDE
- GNU Make
- Python3
You will need to enter basic board info in a plain-text config file and provide variant.h and variant.cpp file for your board.
You also need to have a place where you can upload the completed package - github account is probably the easiest option, but you can also use your own website, hackaday, or anything else.
See Usage Instructions for details
What this tool does (and doesn't) do
This tool builds the bootloader (UF2) and creates the Arduino package archive and index file that make it easy to install the board support in arduino.
It doesn't flash the bootloader to the board. You would need to do it yourself, either using Microchip (formerly Atmel) studio, or by using Adafruit's DAP library.
Current status
Basic functionality is all done - what is left is documentation and testing.