Advanced user guide

Embedded Debugger

The Arduino M0 Pro board is equipped with Atmel Embedded Debugger (EDBG) for on-board debugging. EDBG is a composite USB device having three different interfaces : a debugger, a Virtual COM Port and a Data Gateway Interface (DGI). 
In conjunction with Atmel Studio, the EDBG debugger interface is able to program and debug the ATSAMD21G18A. On the board itself, there are two SWD interfaces : the first one is connected to the EDBG while the other is connected to ATSAMD21G18A.

Since the on-board Virtual COM Port is connected to a UART port on the ATSAMD21G18A, it provides an easy way to communicate with the target application through a simple terminal software. Its features are variable baud rates, parity and stop bit settings. Please note that the settings on the target device UART must match the given settings in the terminal software.

The DGI consists of several physical data interfaces to communicate with the host computer. Communication over the interfaces is bidirectional. It can be used to send events and values from the ATSAMD21G18A, or as a generic printf-style data channel. Traffic over the interfaces can be timestamped on the EDBG for a more accurate tracing of events. Note that timestamping imposes an overhead that reduces maximal throughput. The DGI uses a proprietary protocol, and is thus only compatible with Atmel Studio.

The EDBG controls two LEDs on the M0 Pro : a power and a status LED.

EDBG LED Control:

Operation mode Power LED Status LED
Normal operation Power LED is lit when power is applied to the board. Activity indicator, LED blinks every time something happens on the EDBG.
Bootloader mode (idle) The power LED and the status LED simultaneously blink.
Bootloader mode (firmware upgrade) The power LED and the status LED blink in an alternating pattern.

Burning Bootloader procedure

To properly write the bootloader of Zero PRO, you can use the programming port and the tool provided by ATMEL "AtmelStudio". 
Follow these steps:

1. Open AtmelStudio;

Atmel Studio

2. Plug the Zero PRO board via the "Programming Port" into a USB port of your PC

3. Go to "Tools -> Device Programming" or press the keys "CTRL + SHIFT + P"

Select Device Programming from Atmel Studio

4. in Tool, select "EDBG"

5. in Device, select "ATSAMD21G18A"

6. in Interface, select "SWD"

7. press "Apply"

Device programming

8. Go to "Memories"

​9. Click "Erase now" and, if all has gone as it should, in the log console you will see "OK".

EDBG-Device Programming: Memories 
10. Go to "Fuses"

​11. Ensure that the "NVMCTRL_BOOTPROT" is equal to "0x07", otherwise set this value by double clicking on the value.

​12. Press "Program". In the log console, "OK" will be showed as output if everything has run smoothly.

EDBG-Device Programming: Fuses 
13. Go to "Memories"

​14. Select the file to write (typically Bootloader_board_Vxxx.hex)

​15. Click "Program" and again, in the log console you will see "OK".

Burn the bootloader