Debugging with sleep for ATxmegaA1 rev H and earlier
A bug existed on early versions of ATxmegaA1 devices that prevented the OCD from being enabled while
the device was in certain sleep modes. There are two workarounds to re-enable OCD:
• Go into the Atmel-ICE. Options in the Tools menu and enable "Always activate external reset when
reprogramming device".
• Perform a chip erase
The sleep modes that trigger this bug are:
• Power-down
• Power-save
• Standby
• Extended standby
4.4.14. debugWIRE Special Considerations
The debugWIRE communication pin (dW) is physically located on the same pin as the external reset
(RESET). An external reset source is therefore not supported when the debugWIRE interface is enabled.
The debugWIRE Enable fuse (DWEN) must be set on the target device in order for the debugWIRE
interface to function. This fuse is by default un-programmed when the Atmel AVR device is shipped from
the factory. The debugWIRE interface itself cannot be used to set this fuse. In order to set the DWEN
fuse, the SPI mode must be used. The software front-end handles this automatically provided that the
necessary SPI pins are connected. It can also be set using SPI programming from the Atmel Studio
programming dialog.
Either: Attempt to start a debug session on the debugWIRE part. If the debugWIRE interface is not
enabled, Atmel Studio will offer to retry, or attempt to enable debugWIRE using SPI
programming. If you have the full SPI header connected, debugWIRE will be enabled, and you
will be asked to toggle power on the target. This is required for the fuse changes to be effective.
Or: Open the programming dialog in SPI mode, and verify that the signature matches the correct
device. Check the DWEN fuse to enable debugWIRE.
Important:
It is important to leave the SPIEN fuse programmed, the RSTDISBL fuse un-programmed! Not
doing this will render the device stuck in debugWIRE mode, and High Voltage programming will
be required to revert the DWEN setting.
To disable the debugWIRE interface, use High Voltage programming to un-program the DWEN fuse.
Alternately, use the debugWIRE interface itself to temporarily disable itself, which will allow SPI
programming to take place, provided that the SPIEN fuse is set.
Important:
If the SPIEN fuse was NOT left programmed, Atmel Studio will not be able to complete this
operation, and High Voltage programming must be used.
Atmel Atmel-ICE [USER GUIDE]
Atmel-42330C-Atmel-ICE_User Guide-10/2016
46