Debug
ARM DDI 0363E Copyright ©2009 ARM Limited. All rights reserved. 11-56
ID013010 Non-Confidential, Unrestricted Access
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 11-2 shows.
Example 11-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 11-3 shows the sequence of instructions for sending data to the debugger through the
host-to-target channel.
Example 11-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.
Example11-4 shows the code for target-to-host data transfer.
Example 11-4 Target to host data transfer (host end)
uint32 ReadDCC()
{
// Step 1. Poll DSCR until DTRTXfull is set to 1.
repeat
{
dscr := ReadDebugRegister(34);
}
until (dscr & (1<<29));
// Step 2. Read the value from DTRTX.
dtr_val := ReadDebugRegister(35);
return dtr_val;
}
Example11-5 shows the code for host-to-target data transfer.
Example 11-5 Host to target data transfer (host end)
WriteDCC(uint32 dtr_val)