3.4.4. ETM Programming bit and associated state

The ETM Programming bit disables all ETM functions. See Figure 3.3 for the procedure to change this bit. While it is asserted:

ETM state items

The ETM has five items of state that are affected by the Programming bit:

  • the value of the counters, ETMCNTVRs, 0x05C-0x05F

  • the sequencer

  • the start/stop resource status, bit [2] of the ETMSR

  • the start/stop block

  • the trigger flag, bit [3] of the ETMSR.

ETMv3.0 and earlier

In ETMv3.0 and earlier none of this state can be directly written. It is reset when the Programming bit is set. The values are then held and tracing is disabled until the Programming bit is cleared. For example, a free-running counter does not decrement while the Programming bit is set, and triggers cannot occur.

The state is reset as follows:

  • the counters are reloaded with the value of the appropriate ETMCNTRLDVR

  • the sequencer is reset to state 1

  • the start/stop block is reset to off

  • the triggered bit is cleared to 0, meaning triggers can occur.

The counter value is also updated when the ETMCNTRLDVR is written, if the Programming bit is set.

The start/stop block state can only be read in ETMv2.0 and later. The triggered bit cannot be read until ETMv3.1 See ETMv3.1 and later.

Care must be taken to read the state before setting the Programming bit, otherwise the state is lost.

ETMv3.1 and later

In ETMv3.1 and later the state information can be directly read and written. This means the state information can be saved when powering down the ARM processor, and restored when the system is restarted. See ETM state items for a list of the state information that can be saved and restored in this way.

The state is held while the Programming bit is set and tracing is disabled as before. The state is reset when the Programming bit is cleared, unless written to since the Programming bit was last set. You must set the Programming bit before reading the state. This holds the state stable, ensuring you obtain a consistent result. See Use of the Programming bit for more information.

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