Contents[Hide]

Introduction

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.

Bare SAMD21G
Bare SAMD21G

Atmel-ICE programmer/debugger
Atmel-ICE programmer/debugger

Bare SAMD21G programmer with the Arduino Zero
Bare SAMD21G programmer with the Arduino Zero

Examples

When do we have to burn a bootloader into a bare SAMD21?

  • If a SAMD21 is used in a project like this:

Project with a SAMD21
Project with a SAMD21

  • If the SAMD21 on an Arduino board without Atmel Embedded Debugger (EDBG) has to be replaced. For instance these boards:

SAMD21 Mini Breakout without EDBG
SAMD21 Mini Breakout without EDBG

SAM 15x15 board without EDBG
SAM 15x15 board without EDBG

This text is mis aligned

Circuit explanation

Circuit of the SAMD21 programmer with the Arduino Zero
Circuit of the SAMD21 programmer with the Arduino Zero

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

Arduino Zero modifications
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:

TQFP48 test socket from eBay
TQFP48 test socket from eBay

TQFP48 test socket wiring
TQFP48 test socket wiring

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.

For sale

You can also buy the pre-programmed SAMD21 here:
ATSAMD21G18A-AUT with Arduino Zero Bootloader

 

Do you have any comments? Please let me know.
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.