You can use a trigger signal to specify when a trace run is to occur. You determine the trigger condition by using the event logic (AND/OR) to configure the event resources, such as address comparators and data value comparators.
The trigger event specifies the conditions that must be met to generate a trigger signal on the trace port. When the trigger event occurs, the trigger is output as soon as possible, and therefore might not be aligned with the rest of the trace. The trigger is output over the trace port using a code that can be readily understood by the Trace Capture Device (TCD).
The TCD uses the trigger in the following ways:
This is often called a start trigger that can indicate to the TCD that the trace information must be collected from the trigger point onwards. A start trigger finds out what happens after a particular event, for example, what happens after entering an interrupt service routine. In addition, a small amount of trace data is collected before the trigger condition. This enables the decompression software to synchronize with the trace, ensuring that it can successfully decompress the code around the trigger point.
This is often called a stop trigger which is used to stop collection of the trace. In this case, the TCD acts like a large FIFO so that it always contains the most recent trace information and the older information overflows out of the trace memory. The trigger indicates that the FIFO must stop, so the memory contains all the trace information before the trigger event. A stop trigger finds out what caused a certain event, for example, to see what sequence of code was executed before entering an error handler routine. In addition, a small amount of trace data is collected after the trigger condition.
This is often called a center trigger which you can set between the start point and the stop point. This allows trace memory to contain a defined number of events before the trigger point and a defined number of events after the trigger point.