The ETM implements an idle state that must be entered before you can power down the ETM. Before entry to the idle state, the following sequence occurs:
Trace is turned off.
The ETM waits for all trace that has already been generated to reach the FIFO.
The main FIFO is emptied.
The resynchronizing FIFO is emptied.
The ETM waits for any remaining trace on the ATB interface to be accepted.
The resynchronizing FIFO sets the read and write pointers that is uses to zero.
When in idle state, you can safely remove the power from the ck_gclke or ATCLK domain. It is recommended that you use the OS Save and Restore Registers to save the registers in the ck_gclke domain before removing the power and to restore the registers after restoring the power. See the ETM Architecture Specification for more information.
Following a reset of the ck_gclke domain, the ETM is in idle state. The ETM is also in idle state when any of the following occur:
the power down bit is set
the programming bit is set
the ETMEN bit is cleared
the OS Save and Restore Register lock is set
a WFI idle request is encountered
both the NIDEN and DBGEN inputs are LOW.
The ETM Status Register reports the programming bit as set if both:
the programming bit, power down bit, or OS Save and Restore Register lock is set
the ETM is in idle state.
The standard method to turn off the ETM is to set the programming bit and wait for the ETM Status Register to report the programming bit as set. This method ensures that the idle entry sequence is complete before you can perform further operations.
If the idle request is cancelled before the idle entry sequence is complete, the ETM behaves as if the idle request is maintained until the idle entry sequence is complete. For example, if the programming bit is set and cleared in quick succession without checking the ETM Status Register, the programming bit is not cleared internally until the idle entry sequence has completed.
When a WFI occurs, the processor waits for the idle entry sequence to complete before stopping the clock to the ETM.