Arduino SAM Tutorial
Installing
To install the Arduino Core, add the following URL to "Additional Boards Manager URLs":
https://raw.githubusercontent.com/qbolsee/ArduinoCore-fab-sam/master/json/package_Fab_SAM_index.json
You can then install the package by opening up the Boards Manager:
And looking for a package called "Fab SAM core for Arduino". Simply install the latest version:
A new menu appears under "board", letting you select a variety of chips. Some generic names contain an "x", for instance for a SAMD21E17, you would select "Generic x21E":
Then select the right microcontroller in the next menu:
With bootloader
Because the SAMD family has native USB support, they can easily talk to the host computer using a CDC serial class. A neat trick is to use this serial port not only to communicate, but also upload your binary when needed.
This can be achieved with a bootloader, that first needs to be installed on the microcontroller using an external programmer. After this, your board will behave like an official Arduino board and can be flashed through the serial port without any programmer plugged in.
Burn bootloader
Upload
Upload with programmer
Without bootloader
As expained previously, bootloaders use some of the flash. With the SAMD11, we only have 16kb of total flash, and the bootloader would use 4kb of that.
In some applications, you want to recover those 4kb