Debug

{

//Step 1. Poll DSCR until DTRRXfull is clear. repeat

{

dscr := ReadDebugRegister(34);

}

until (!(dscr & (1<<30)));

//Step 2. Write the value to DTRRX. WriteDebugRegister(32, dtr_val);

}

While the processor is running, if the DCC is used as a data channel, it might be appropriate to poll the DCC regularly.

Example 11-6shows the code for polling the DCC.

Example 11-6 Polling the DCC (host end)

PollDCC

{

dscr := ReadDebugRegister(34); if (dscr & (1<<29))

{

//DTRTX (target -> host transfer register) full dtr := ReadDebugRegister(35) ProcessTargetToHostWord(dtr);

}

if (!(dscr & (1<<30)))

{

//DTRRX (host -> target transfer register) empty dtr := GetNextHostToTargetWord() WriteDebugRegister(32, dtr);

}

}

11.11.2 Programming breakpoints and watchpoints

This section describes the following operations:

Programming simple breakpoints and the byte address select

Setting a simple aligned watchpoint on page 11-58

Setting a simple unaligned watchpoint on page 11-59.

Programming simple breakpoints and the byte address select

When programming a simple breakpoint, you must set the byte address select bits in the control register appropriately. For a breakpoint in ARM state, this is simple. For Thumb state, you must calculate the value based on the address.

ARM DDI 0363E

Copyright © 2009 ARM Limited. All rights reserved.

11-57

ID013010

Non-Confidential, Unrestricted Access

 

Page 326
Image 326
ARM r1p3, R4F manual Programming breakpoints and watchpoints, This section describes the following operations