SoC
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
  • Arm Cortex M3
  • Contact
Reading: What is the ARM Debug Access Port?
SUBSCRIBE
SoCSoC
Font ResizerAa
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
Search
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
Have an existing account? Sign In
Follow US
  • Looking for Something?
  • Privacy Policy
  • About Us
  • Sitemap
  • Contact Us
© S-O-C.ORG, All Rights Reserved.
Arm

What is the ARM Debug Access Port?

Scott Allen
Last updated: September 11, 2023 3:41 am
Scott Allen 8 Min Read
Share
SHARE

The ARM Debug Access Port (DAP) is an interface that provides debug access to ARM processor cores. It allows debugging tools like GDB to communicate with the processor core and perform debugging operations like halting execution, reading and writing registers and memory, and single stepping through instructions.

Contents
Overview of the ARM Debug Access PortDAP ImplementationsARM DAPv1ARM DAPv2ARM CoreSight DAPCMSIS-DAPUsing the Debug Access PortExample Debug SessionDAP Advantages for DebuggingConclusion

Overview of the ARM Debug Access Port

The DAP provides a standard way for debugging tools to access ARM cores without needing to know the details of the system the core is integrated into. This makes it easier to retarget debugging tools to different ARM-based chips.

The DAP uses a JTAG interface, so it is sometimes referred to as JTAG debugging. But whereas JTAG is a general purpose interface that could be used for things other than debugging, the DAP is dedicated to debug access.

The DAP has two main components:

  • Debug Access Port Transport (DAPT): Provides the interface between the debugger and the chip’s debugging circuitry. This handles the low-level JTAG signaling and data transfer.
  • Access Port (AP): Allows access to specific debugging components like processor cores. A chip will typically have at least one AP per processor core.

The AP allows debug access to components like:

  • Core registers
  • Breakpoint registers
  • Watchpoint registers
  • Debug control registers
  • Memory access

The AP provides atomic operations so that these components can be safely accessed even while the processor is running.

DAP Implementations

There are several different versions and implementations of the DAP:

ARM DAPv1

The original DAP specification provided a basic debug interface for ARM7 and ARM9 cores. It includes:

  • A JTAG Debug Port (JDP) for communicating with the debugger
  • A Debug Access Port (DAP) for accessing the processor core

This provides a simple way to access the processor core registers and memory while debugging.

ARM DAPv2

An enhanced version that added support for:

  • Managing debug authentication
  • Accessing multiple APs
  • Memory mapped access to APs

This allows debugging more complex multi-core and multi-processor systems.

ARM CoreSight DAP

CoreSight is ARM’s platform for debug and trace hardware built around the DAP interface. CoreSight DAP implementations include:

  • JTAG-DP: JTAG Debug Port
  • SW-DP: Single-Wire Debug Port, a two-pin serial version of the JTAG-DP
  • SWJ-DP: Serial Wire JTAG Debug Port, which combines JTAG and SWD

These provide debug access in ARM CoreSight compliant systems.

CMSIS-DAP

The Cortex Microcontroller Software Interface Standard – Debug Access Port (CMSIS-DAP) is a specification for DAP implementations that connect ARM cores to a USB host in embedded systems. This allows easy debugging via USB without needing extra debug hardware.

Many low cost development boards include a CMSIS-DAP compatible debug interface chip to make it easy to connect to a computer and start debugging.

Using the Debug Access Port

The DAP provides an interface for tools to access ARM cores, but by itself does not provide high-level debugging functionality. Debuggers and other tools are needed to leverage the DAP capabilities.

For example, GDB communicates with the DAP to control execution and access registers and memory on the processor. IDEs and other tools likewise use the DAP interface for debugging tasks.

Using the DAP for debugging typically involves:

  1. Connecting to the DAP hardware interface (JTAG, SWD, USB, etc).
  2. Initializing the DAP and accessing the debug AP.
  3. Querying the DAP and AP capabilities.
  4. Attaching to the core(s) to be debugged.
  5. Using the DAP to halt, resume, step cores and access their state while debugging.

Software drivers and libraries like CMSIS-DAP handle the low level signaling and provide an API to access the DAP capabilities. Debugger frontends and IDEs build on these APIs to allow controlling debugging via the DAP.

Example Debug Session

A typical debug session using the DAP may involve:

  1. Connect to the target board via JTAG, SWD, or USB interface.
  2. Open the debugger and configure it for the target.
  3. Initialize the DAP and connect to the core’s AP.
  4. Reset and halt the core before the first instruction.
  5. Set breakpoint(s) at code location(s) of interest.
  6. Let the core run until a breakpoint is hit.
  7. Examine core registers, memory, variables, etc.
  8. Step through code line by line while monitoring state.
  9. Go back to setting new breakpoints, running, and debugging as needed.

The DAP provides the low-level interface for the debugger to control the chip and processor. The debugger software provides the user interface and higher level debugging capabilities during a debug session.

DAP Advantages for Debugging

Using the ARM Debug Access Port for debugging and development provides several benefits:

  • Standardized interface – The DAP provides a standardized way to access debug components on ARM chips. This enables reuse of debugger software across ARM-based designs.
  • Processor and system agnostic – Debug tools don’t need to know the details of the ARM chip or system, just the DAP interface. This makes them easy to retarget to new hardware.
  • Atomic access – The DAP ensures safe atomic access to debug components, even while the processor is running.
  • Optimized for debugging – Since it is dedicated for debug, the DAP provides capabilities tailored specifically for debugging needs.
  • Efficient – The DAP provides fast debug access without disrupting real-time system operation when halting or stepping cores.
  • Flexible – DAP implementations using JTAG, SWD, USB, etc. allow interfacing with various hosts and platforms.

By leveraging the DAP, developers can start debugging ARM-based designs faster and efficiently access on-chip debugging components. The DAP helps enable a robust ecosystem of portable ARM debug tools.

Conclusion

The ARM Debug Access Port provides a standardized interface to access the debugging components on ARM processors. It enables debugger tools to halt, control, and monitor ARM cores without needing intimate knowledge of the target system.

The DAP’s atomic access, optimized debug features, and flexibility have made it the interface of choice for ARM debugging. DAP implementations like CoreSight and CMSIS-DAP further extend its capabilities. By offloading the debug interface complexities onto the DAP, tool providers can focus on high-level debugging utilities for a wide range of ARM-based designs.

Newsletter Form (#3)

More ARM insights right in your inbox

 


Share This Article
Facebook Twitter Email Copy Link Print
Previous Article How to Install ARM GCC Compiler
Next Article What are the different debug interfaces that are available on the Cortex-M processor?
Leave a comment Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

2k Followers Like
3k Followers Follow
10.1k Followers Pin
- Sponsored-
Ad image

You Might Also Like

Cortex-M3 Memory Region Shareability and Cache Policies (Explained)

The Cortex-M3 memory system allows configuring memory regions to be…

9 Min Read

ARM Cortex-M4 Memory Map

The ARM Cortex-M4 is a 32-bit processor core used in…

8 Min Read

Configuring Memory and Caches for Arm Cortex-M1

The Arm Cortex-M1 processor is designed for low-power embedded applications.…

6 Min Read

What are the fundamentals of the ARM Cortex M3?

The ARM Cortex-M3 is a 32-bit processor core designed for…

6 Min Read
SoCSoC
  • Looking for Something?
  • Privacy Policy
  • About Us
  • Sitemap
  • Contact Us
Welcome Back!

Sign in to your account