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.
- Write 0x20 to HWBP_CNTL (STOP = 1, BUS_SEL = 000/PAB). If a trace is to be
generated instead of a breakpoint, then set HWBP_CNTL to 0x40 instead of
(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 0x2C to HWBP_CNTL (STOP = 1, BUS_SEL = 011/DRAB). If an RTOSINTn is
to be generated instead of a watch point, then set HWBP_CNTL to 0x4C instead
(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 0x28 to HWBP_CNTL (STOP = 1, BUS_SEL = 010/DWAB). If an RTOSINTn is
to be generated instead of a watch point, then set HWBP_CNTL to 0x48 instead
(STOP =0)
- Enable the corresponding
module bit in the global enable register.