2.4. Triggering a trace run

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 to configure the event resources. See ETM event logic and ETM event resources.

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). See Decoding required by trace capture devices.

The TCD uses the trigger in the following ways:

Trace after

The trigger can indicate to the TCD that the trace information must be collected from the trigger point onwards. This is often called a start trigger and is used to find out what happens after a particular event, for example what happens after entering an interrupt service routine. Often, 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.

Trace before

The trigger can be 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. This is often called a stop trigger and is used to find out what caused a certain event, for example, to see what sequence of code was executed before entering an error handler routine. Often, in addition, a small amount of trace data is collected after the trigger condition.

Trace about

You can set the trigger between the start point and the stop point, so that the trace memory contains a defined number of events before the trigger point and a defined number of events after it. This is often called a centre trigger.

The generation of a trigger does not affect the tracing in any way.

A simple trigger can be based on memory access address or data matches, for example the execution of an instruction from a particular address. However, a more complicated set of trigger conditions is possible, such as executing a particular instruction several times, or a particular sequence of events occurring before the trigger is asserted.

In any trace run, only a single trigger can be generated by the ETM. However multiple triggers from different sources are permitted in a CoreSight system. See the CoreSight Architecture Specification for more information. When the trigger has been asserted you must set the ETM Programming bit of the ETMCR to 1, and then clear it to 0, before another run can begin. For more information see Main Control Register, ETMCR.

Copyright © 1999-2002, 2004-2009, 2011 ARM Limited. All rights reserved.ARM IHI 0014Q