Development Support
MPC561/MPC563 Reference Manual, Rev. 1.2
Freescale Semiconductor
23-5
Program trace can be used in various ways. Below are two examples of how program trace can be used:
Back trace — Back trace is useful when a record of the program trace before some event occurred
is needed. An example of such an event is some system failure.
In case back trace is needed the external hardware should start sampling the status pins (VF and
VFLS) and the address of all cycles marked with the program trace cycle attribute immediately
when reset is negated. If show cycles is programmed out of reset to show all, all cycles marked
with program trace cycle attribute are visible on the external bus. VSYNC should be asserted
sometime after reset and negated when the programmed event occurs. If no show is programmed
for show cycles, make sure VSYNC is asserted before the Instruction show cycles programming is
changed from show all.
Note that in case the timing of the programmed event is unknown it is possible to use cyclic buffers.
After VSYNC is negated the trace buffer will contain the program flow trace of the program
executed before the programmed event occurred.
Window trace — Window trace is useful when a record of the program trace between two events
is needed. In case window trace is needed the VSYNC pin should be asserted between these two
events.
After the VSYNC pin is negated the trace buffer will contain information describing the program
trace of the program executed between the two events.
23.1.4.1
Synchronizing the Trace Window to the CPU Internal Events
The assertion/negation of VSYNC is done using the serial interface implemented in the development port.
In order to synchronize the assertion/negation of VSYNC to an internal event of the CPU, it is possible to
use the internal breakpoints together with debug mode. This method is available only when debug mode
The following is an example of steps that enable synchronization of the trace window to the CPU internal
events:
1. Enter debug mode, either immediately out of reset or using the debug mode request
2. Program the hardware to break on the event that marks the start of the trace window using the
3. Enable debug mode entry for the programmed breakpoint in the debug enable register (DER). See
5. The hardware generates a breakpoint when the programmed event is detected and the machine
6. Program the hardware to break on the event that marks the end of the trace window
7. Assert VSYNC
8. Return to the regular code run. The first report on the VF pins is a VSYNC (VF = 011).
9. The external hardware starts sampling the program trace information upon the report on the VF
pins of VSYNC
10. The hardware generates a breakpoint when the programmed event is detected and the machine
enters debug mode