Attaching to a Target

To attach a target, use the Attach to Target option in the Debug menu, or the attach icon in the debug toolbar. This causes Atmel Studio to launch a debug session on the selected target without uploading a new application or causing a reset. Once the debug session is established, the core of the target is halted and the current execution position of the target is mapped to the code in the project. This means that the state of the target is kept and is possible to inspect with normal debug techniques, and the program halts in the current position. Full run control and symbolic debugging should be available after a successful attach.
  • The code in the project is mapped to the content of the running target, without any possibility to verify the correctness of this mapping. This means that if the project contains code that is not on the target, then the state and run control might not reflect the truth, as variables and functions might have different code locations on the target than in the project.

  • The ability to activate a debug session without resetting a target is architecture dependent. Not all architectures support this feature.


Physically connecting a debug probe to a target might cause the target to reset, as most debug probes need an electrical connection to the reset line of the device. Normal electrical precautions need to be taken to avoid this.