DCC

From SEGGER Wiki
Revision as of 16:06, 5 September 2019 by Rolf (talk | contribs)
Jump to: navigation, search


The Debug Communication Channel (DCC) is a simply communication mechanism which allows the debug probe to communicate with the program running on the target processor, using the debug interface (typically JTAG). In contrast to semihosting, which halts the target CPU, it allows communication with the processor without halting the program. Communication is bidirectional.

Supported devices

DCC is available on ARM7/ARM9/ARM11 and Cortex-A/Cortex-R processors. Similar mechanisms have been introduced by other silicon vendors for their cores.

Implementation

DCC is implemented in what ARM calls "coprocessor 14" and contains three registers:

  • A 32-bit read register, used to transfer data down from debugger to the target, so read from target, written via debug interface
  • A 32-bit write register, used to transfer data up to the debugger, so written from target
  • A 32-bit control register (Where two bits are used, a 1 indicating that data is available). Set on write

The target application can send data to the debugger using the write register. When a word is loaded into the register, the W bit in the control register is set to notify the debug probe / debugger. The debugger reads the write register, which automatically the W bit.

The target application can read data from the debugger using the read register. The debugger can write a word to the read register and set the R bit in the control register to notify the target application. When the target application reads the read register, the R bit is cleared again.

Interrupts

The target application can poll the R and W bit of the control register to check whether it can send or receive data. Alternatively, changes of the bits can be made available as COMMRX and COMMTX interrupts to enable more efficient interrupt-driven communication. However, interrupts are rarley used in combination with DCC as they introduce additional complexity and are not available on all cores.

Protocol

DCC can be used to transfer any kind of data while the target CPU is running. Unfortunately, ARM failed to suggest a standard communication protocol. DCC can be used with J-Link debug probes in different ways. It is completely up to the application programmer which data he wants to transfer. The application programmer is free to define is own protocol and can use J-Link to read the data on the host side.

It is most commonly used for debug printf output or for system information, such as in embOS View.