The programming sequence is identical when using
the EBC units, regardless of whether the debug software or the application is
programing the units. A typical programming sequence for a unit is:
- Read and make sure the
ownership is set as expected; if not, acquire the ownership before
proceeding further if required.
- Make sure the unit is in IDLE
mode.
- Set up the address reference,
mask, bus select and stop bits.
- Enable the corresponding
module bit in the global enable register.
- Once the usage is completed,
write 1 to clear the EVENT_FIRED sticky bit. This takes the module back to
the enabled state.
The example programming sequences for hardware
breakpoints and hardware watch points are:
Set a hardware breakpoint on address 0x201000:
- Read GLBL_OWNER to confirm
ownership.
- Read HWBP_STATUS to confirm
the module is in IDLE state.
- Write 0x0 to HWBP_MASK.
- Write 0x201000 to
HWBP_REF.
- Set HWBP_CNTL.STOP = 1 and HWBP_CNTL.BUS_SEL = 0000 (PAB). If a trace is to
be generated instead of a breakpoint, set HWBP_CNTL.STOP = 0.
- Enable the corresponding
module bit in the global enable register.
Set a hardware watch point on read of addresses
from 0x121010 to 0x12101F:
- Read GLBL_OWNER to confirm
ownership.
- Read HWBP_STATUS to confirm
the module is in IDLE state.
- Write 0xF to HWBP_MASK.
- Write 0x121010 to
HWBP_REF.
- Write HWBP_CNTL.STOP = 1 and HWBP_CNTL.BUS_SEL = 0011 (DRAB). If an
RTOSINTn is to be generated instead of a watch point, set HWBP_CNTL.STOP =
0.
- Enable the corresponding
module bit in the global enable register.
Set a hardware watch point on write to address
0xFF10101A:
- Read GLBL_OWNER to confirm
ownership
- Read HWBP_STATUS to confirm
the module is in IDLE state
- Write 0x0 to HWBP_MASK
- Write 0xFF10101A to
HWBP_REF
- Write HWBP_CNTL.STOP = 1, HWBP_CNTL.BUS_SEL = 0010 (DWAB). If an RTOSINTn
is to be generated instead of a watch point, set HWBP_CNTL.STOP = 0.
- Enable the corresponding
module bit in the global enable register.