
Chapter 11. Debug Support
For More Information On This Product,
Go to: www.freescale.com
11-57
Real-Time Debug Support
1. It saves a copy of the current value of the emulator mode state bit and then exits
emulator mode by clearing the actual state.
2. Bit 1 of the fault status field (FS1) in the next exception stack frame is set to
indicate the processor was in emulator mode when the interrupt occurred. This
corresponds to bit 17 of the longword at the top of the system stack. See
Section 7.3, “Exception Stack Frame Definition.”
3. It passed control to the appropriate exception handler.
4. It executes an RTE instruction when the exception handler finishes. During the
processing of the RTE, FS1 is reloaded from the system stack. If this bit is set, the
processor sets the emulator mode state and resumes execution of the original debug
interrupt service routine. This is signaled externally by the generation of the PST
value that originally identified the debug interrupt exception, that is, PST = 0xD.
Fault status encodings are listed in Table 10-2. Implementation of this debug interrupt
handling fully supports the servicing of a number of normal interrupt requests during a
debug interrupt service routine.
The emulator mode state bit is essentially changed to be a program-visible value, stored
into memory during exception stack frame creation, and loaded from memory by the RTE
instruction.
When debug interrupt operations complete, the RTE instruction executes and the
processor exits emulator mode. After the debug interrupt handler completes execution, the
external development system can use BDM commands to read the reserved memory
locations.
In Revision A, if a hardware breakpoint such as a PC trigger is left unmodified by the
debug interrupt service routine, another debug interrupt is generated after the completion
of the RTE instruction. In Revisions B and C, the generation of another debug interrupt
during the first instruction after the RTE exits emulator mode is inhibited. This behavior is
consistent with the existing logic involving trace mode where the first instruction executes
before another trace exception is generated. Thus, all hardware breakpoints are disabled
until the first instruction after the RTE completes execution, regardless of the programmed
trigger response.
11.6.1.1 Emulator Mode
Emulator mode is used to facilitate nonintrusive emulator functionality. This mode can be
entered in three different ways:
Setting CSR[EMU] forces the processor into emulator mode. EMU is examined
only if RSTI is negated and the processor begins reset exception processing. It can
be set while the processor is halted before reset exception processing begins. See
Section 11.5.1, “CPU Halt.”
A debug interrupt always puts the processor in emulation mode when debug
interrupt exception processing begins.
F
Freescale Semiconductor, Inc.
n
.