Debug
ARM DDI 0363G Copyright © 2006-2011 ARM Limited. All rights reserved. 12-59
ID073015 Non-Confidential
Software access to the DCC
Software running on the processor that sends data to the debugger through the target-to-host
channel can use the sequence of instructions that Example 12-2 shows.
Example 12-2 Target to host data transfer (target end)
; r0 -> word to send to the debugger
WriteDCC MRC p14, 0, PC, c0, c1, 0
BEQ WriteDCC
MCR p14, 0, Rd, c0, c5, 0
BX lr
Example 12-3 shows the sequence of instructions for sending data to the debugger through the
host-to-target channel.
Example 12-3 Host to target data transfer (target end)
; r0 -> word sent by the debugger
ReadDCC MRC p14, 0, PC, c0, c1, 0
BCC ReadDCC
MRC p14, 0, Rd, c0, c5, 0
BX lr
Debugger access to the DCC
When not in debug state, a debugger can access the DCC through the external interface. The
following examples show the pseudo-code operations for these accesses.
Example 12-4 shows the code for target-to-host data transfer.
Example 12-4 Target to host data transfer (host end)
uint32 ReadDCC()
{
// Step 1. Poll DBGDSCR until DTRTXfull is set to 1.
repeat
{
dscr := ReadDebugRegister(34);
}
until (dscr & (1<<29));
// Step 2. Read the value from DBGDTRTX.
dtr_val := ReadDebugRegister(35);
return dtr_val;
}
Example 12-5 on page 12-60 shows the code for host-to-target data transfer.