2 programming breakpoints and watchpoints – ARM Cortex R4F User Manual

Page 326

Advertising
background image

Debug

ARM DDI 0363E

Copyright © 2009 ARM Limited. All rights reserved.

11-57

ID013010

Non-Confidential, Unrestricted Access

{

// 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-6 shows 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.

Advertising
This manual is related to the following products: