The SAMD21 bootloader is used to communicate with the Arduino IDE through its internal USB port, also called the native port. Burning a bootloader into a bare SAMD21 can be done with a programmer like the Atmel ICE, but we can also use an Arduino Zero. Here I will tell how to do it.
When do we have to burn a bootloader into a bare SAMD21?
- If a SAMD21 is used in a project like this:
- If the SAMD21 on an Arduino board without Atmel Embedded Debugger (EDBG) has to be replaced. For instance these boards:
This text is mis aligned
Burning the bootloader is only possible by use of the programming port, not the native USB port. The EDBG takes care of the programming. Three control signals are used: SWDIO, SWCLK and RESET and these can program the on-board SAMD21 and also an external SAMD21. The signals SWDIO and SWCLK have to be switched between the on-board SAMD21 and the external SAMD21G, see the schematic.
Arduino Zero modifications
Note: there are cheap Arduino Zero board variants without the programming port, you can't use these. Remove the resistors R105 and R104, see the image. I used the Arduino M0 Pro, whose resistors are respectively R2 and R3.
Glue two SMD toggle switches and a 5 pin male connector to the board, I prefer Polyurethane glue.
Use the free pads of the removed resistors for soldering the wires to.
TQFP48 socket program adapter
You can get a socket program adapter at eBay:
If the test socket has stacked PCBs, saw off the bottom PCB.
Wire the JST socket connector.
Solder the two capacitors to the board.
Wire the board according the schematic on your own understanding.
Sometimes we have to cut some traces on the board.
Burning the bootloader into the external SAMD21
First check if you can burn the bootloader into the on-board SAMD21 as before; first turn the switches in de right position.
To burn the bootloader into the external SAMD21, put the switches in de other position.
You can also buy the pre-programmed SAMD21 here:
ATSAMD21G18A-AUT with Arduino Zero Bootloader
- cogito ergo blog
- Mini SAMD21 development board 15x15mm (Arduino compatible)
- SAMD21 for dummies
- Arduino Zero for dummies
- How to use all SAMD21G pins
- SAMD21 Arduino bootloader virus