Home Getting Started About Download Source Report An Issue

Enabling "AVR/EDBG mode" on the MPLAB Snap on Linux

The MPLAB Snap device is a hybrid device - that is, it can present itself as an "MPLAB Snap ICD" device, as well as an EDBG (Embedded Debugger) device. The device is known to be in "AVR mode" when configured to present itself as an EDBG device. The device switches between these two modes via a firmware update, issued by Microchip software (the MPLAB IDE and IPE).

In order to use the MPLAB Snap to program and debug AVR microcontrollers, it must first be flashed into AVR mode.

Bloom will fail to recognise the device until AVR mode has been enabled.

Confirm the device is not already in AVR/EDBG mode

Before flashing the device into AVR mode, it may be worth confirming that the device is not already in AVR mode. When in AVR mode, the device will use the Atmel vendor ID 1003 (0x03eb) and the product ID 8576 (0x2180). When the device is not in AVR mode, it will use the Microchip vendor ID 1240 (0x04d8) and the product ID 36888 (0x9018). Upon connecting the MPLAB Snap device, run the following command:

$ lsusb -d 04d8:9018;

If the device is not in AVR mode, the following string should be output:

Bus XXX Device XXX: ID 04d8:9018 Microchip Technology, Inc.

If no such string is output, the device is likely already in AVR mode. Skip to the Confirmation section to confirm this.

Installing MPLAB IPE

Bloom cannot flash the MPLAB Snap device into AVR mode - it must be done via Microchip's MPLAB IPE software. This can be installed via the MPLAB IDE installer. Download the installer from the Microchip website. Select the MPLAB IPE option and proceed with the installation.

Selecting MPLAB IPE within MPLAB IDE installer

Flashing the MPLAB Snap into AVR mode via MPLAB IPE

NOTE: MPLAB IPE may fail to flash the device with the EDBG firmware, if this is the first instance of use, for the particular device.


If the device is brand new or this is the first instance of use, since purchase, the device may first need to be flashed with the standard firmware before it can be flashed with the EDBG firmware. See the Flashing the device with the standard firmware section below for instructions.


Upon flashing the new device with the standard firmware, you can now proceed to flash the device with the EDBG firmware.

Open MPLAB IPE and select any target within the AVR 8-bit family.

The MPLAB Snap does not need to be connected to the selected target. It can remain disconnected throughout this process.


Flashing the MPLAB Snap into AVR Mode, via the Microchip MPLAB IPE software

Select the 'Read' function. The device will now be flashed with the appropriate firmware. Ignore any errors relating to target connection. Once the device has been flashed, it will perform a hard USB reset. The device should now present itself as an EDBG device.

Flashing the device with the standard firmware


Upon flashing the device with the EDBG firmware, you will no longer be able to use it for programming/debugging operations with any target from the PIC family, until the device has been flashed with the standard firmware.


To flash the device with the standard firmware, simply follow the instructions above, but when selecting a target, be sure to select one from the PIC family, as opposed to one from the AVR family.

Confirmation

As mentioned above, the device will use a different vendor and product ID when in AVR mode. To confirm the operation was successful, run the following command with the device connected:

$ lsusb -d 03eb:2180;

If the device is in AVR mode, the following string should be output:

Bus XXX Device XXX: ID 03eb:2180 Atmel Corp.

Debugging AVR targets with the MPLAB Snap

Once the device has been flashed with the EDBG firmware, it can be used in conjunction with Bloom, to perform debugging operations on over 200 AVR 8-bit targets.

To begin debugging with the MPLAB Snap, on Linux, follow the instructions at Getting Started with Bloom.