
Debug Support
MOTOROLA
ColdFire2/2M User’s Manual
For More Information On This Product,
Go to: www.freescale.com
7-27
The breakpoint status is also posted in the
CSR
.
The new BDM instructions load and configure the desired breakpoints using the appropriate
registers. As the system operates, a breakpoint trigger generates a response as defined in
the
TDR
. If the system can tolerate the processor being halted, a BDM entry can be used.
With the TRC bits of the TDR = $1, the breakpoint trigger causes the core to halt as reflected
in the status of PST = $F. For PC breakpoints, the halt occurs before the targeted instruction
is executed. For address and data breakpoints, the processor may have executed several
additional instructions. As a result, trigger reporting is considered imprecise.
If the processor core cannot be halted, the special debug interrupt can be used. With this
configuration, TRC bits of the
TDR
= $2
, the breakpoint trigger is converted into a debug
interrupt to the processor (see
Section 4.2.8 Debug Interrupt
.) This interrupt is treated as
higher than the nonmaskable level 7 interrupt request. As with all interrupts, it is made
pending when the processor samples, once per instruction. Again, the hardware forces the
PC
breakpoint to occur immediately (before the execution of the targeted instruction). This
is possible because the PC breakpoint comparison is enabled at the same time the interrupt
sampling occurs. For the address and data breakpoints, the reporting is considered
imprecise because several additional instructions may be executed after the triggering
address or data is seen.
Once the debug interrupt is recognized, the processor aborts execution and initiates
exception processing. At the initiation of the exception processing, the core enters emulator
mode. After the standard 8-byte exception stack is created, the processor fetches a unique
exception vector, $C, from the vector table.
Execution continues at the instruction address contained in this exception vector. All
interrupts are ignored while in emulator mode. Users can program the debug-interrupt
handler to perform the necessary context saves using the supervisor instruction set. As an
example, this handler may save the state of all the program-visible registers as well as the
current context into a reserved memory area.
Once the required operations are complete, the return-from-exception (RTE) instruction is
executed and the processor exits emulator mode. Once the debug interrupt handler has
completed its execution, the external development system can then access the reserved
memory locations using the BDM commands to read memory.
Table 7-8. DDATA, CSR[31:28] Breakpoint Response
DDATA[3:0], CSR[31:28]
$0
$1
$2
$3-4
$5
$6
$7-$F
BREAKPOINT STATUS
No breakpoints enabled
Waiting for level 1 breakpoint
Level 1 breakpoint triggered
Reserved
Waiting for level 2 breakpoint
Level 2 breakpoint triggered
Reserved
F
Freescale Semiconductor, Inc.
n
.