5.1 Debugging with ATATMEL-ICE Development Tool

The ATATMEL-ICE is a powerful development tool for debugging and programming ARM Cortex-M-based Microchip SAM and Microchip AVR microcontrollers with on-chip debug capability. The user can program and debug the ATSAMC21 MCU using the debug system (EDBG) on the ATSAMC21-XPRO board, which does not require the debugger, while the ATAUWB-EK1 does not contain EDBG and requires the debugger.

For debugging with the ATATMEL-ICE development tool, perform the following steps:
  1. Install Microchip Studio version 7 or later on the user computer because the ATATMEL-ICE debugger unit requires a front-end debugging environment.
    Figure 5-1. ATATMEL-ICE Debugger
  2. Connect the ATATMEL-ICE to the host computer using the USB cable provided or with a certified Micro-USB cable.
  3. The tool must connect to the port corresponding to the pinout of the target. In the current document, the target is SAM, which is also illustrated in the following figure.
    Figure 5-2. ATATMEL-ICE Debugger SAM Probe Connection
  4. The ATATMEL-ICE contains a USB 2.0-compliant controller, and operates in both Full-speed and High-speed modes.
    Note: For best results, connect the ATATMEL-ICE directly to a USB-compliant high-speed hub on the host computer.
  5. After connecting the ATATMEL-ICE to the computer, launch Microchip Studio.
  6. On the Microchip Studio Device Programming windows, select ATATMEL-ICE in the Tool tab.
  7. Look for ATSAMC21E16A, which is used as a host MCU in ATAUWB-EK1.
  8. Click the Apply button (see Figure 5-4) and both of the green LEDs on the ATAUWB-EK1 boards turn ON, as illustrated in the following figure.
    Note:
    • If the green LED is still OFF, check the error message in Microchip studio and follow the instructions in the error message.
    • The ATAUWB-EK1 needs a separate power source (through the mini USB port, which is connected to a personal computer), while the ATATMEL-ICE debugger is not able to power up the ATAUWB-EK1.
    Figure 5-3. ATATMEL-ICE Debugger Connects to ATAUWB-EK1 via SAM Probe Connection
  9. If the connections are correct and the green LEDs turn on, click the Read tab on the Device signature. The MCU board signature displays in the Device signature tab, which is 0x1101040C for the current example, as illustrated in the following figure.
    Note: The ATAUWB-EK1, which is used as a prover board in variant B, cannot be programmed or debugged through the COM port. The host controller on this board is debugged and programmed with the ATATMEL-ICE debugger. It is recommended that the same process described in this section be followed. The only difference is, use the ATSAMC21E16A as the host controller on the ATAUWB-EK1.
    Figure 5-4. Microchip Studio Device Programming Windows
Note: For more information, refer to the AT6491 Getting Started with SAM C21 SMART ARM Based Microcontroller Application Note and www.microchip.com.