9: Debugging Your System
ARM720T CORE CPU MANUAL EPSON 9-37
3 Program the data value register only when you require a data-dependent
breakpoint, that is only when you have to match the actual instruction code fetched
as well as the address. If the data value is not required, program the data mask
register to 0xFFFFFFFF (all bits set). Otherwise program it to 0x00000000.
4 Program the control value register with PROT[0] = 0.
5 Program the control mask register with PROT[0]= 0, all other bits set.
6 When you have to make the distinction between User and non-User mode
instruction fetches, program the PROT[1] value and mask bits appropriately.
7 If required, program the DBGEXT, RANGE, and CHAIN bits in the same way.
8 Set the mask bits for all unused control values.
Note: In monitor mode, you must set the EmbeddedICE-RT disable bit (bit 5 in the Debug
Control Register) before changing the register values, and clear it on completion of
the programming.
9.21.2 Software breakpoints
To make a watchpoint unit cause software breakpoints (on instruction fetches of a particular
bit pattern):
1 Program the address mask register of the watchpoint unit to 0xFFFFFFFF (all bits
set) so that the address is disregarded.
2 Program the data value register with the particular bit pattern that has been
chosen to represent a software breakpoint.
If you are programming a Thumb software breakpoint, repeat the 16-bit pattern in
both halves of the data value register. For example, if the bit pattern is 0xDFFF,
program 0xDFFFDFFF. When a 16-bit instruction is fetched, EmbeddedICE-RT
compares only the valid half of the data bus against the contents of the data value
register. In this way, you can use a single watchpoint register to catch software
breakpoints on both the upper and lower halves of the data bus.
3 Program the data mask register to 0x00000000.
4 Program the control value register with PROT[0] = 0.
5 Program the control mask register with PROT[0] = 0 and all other bits set.
6 If you want to make the distinction between User and non-User mode instruction
fetches, program the PROT[1] bit in the control value register and control mask
register accordingly.
7 If required, program the DBGEXT, RANGE, and CHAIN bits in the same way.
Note: You do not have to program the address value register.
Setting the breakpoint
To set the software breakpoint:
1 Read the instruction at the desired address and store it.
2 Write the special bit pattern representing a software breakpoint at the address.
Clearing the breakpoint
To clear the software breakpoint, restore the instruction to the address.