MTB_MASTER field descriptions (continued)
Field
Description
7
SFRWPRIV
Special Function Register Write Privilege
If this field is 0, then user or privileged AHB read and write accesses to the MTB_RAM Special Function
Registers (programming model) are permitted. If this field is 1, then only privileged write accesses are
permitted; user write accesses are ignored. The HPROT[1] signal determines if an access is user or
privileged. Note MTB_RAM SFR read access are not controlled by this bit and are always permitted.
6
TSTOPEN
Trace Stop Input Enable
If this field is 1 and the TSTOP signal is HIGH, then EN is set to 0. If a trace packet is being written to
memory, the write is completed before tracing is stopped.
5
TSTARTEN
Trace Start Input Enable
If this field is 1 and the TSTART signal is HIGH, then EN is set to 1. Tracing continues until a stop
condition occurs.
MASK
Mask
This value determines the maximum size of the trace buffer in RAM. It specifies the most-significant bit of
the MTB_POSITION[POINTER] field that can be updated by automatic increment. If the trace tries to
advance past this power of two, the MTB_POSITION[WRAP] bit is set to 1, the MTB_POSITION[MASK
+3:3] == MTB_POSITION[POINTER[MASK:0]] bits are set to zero, and the MTB_POSITION[14:MASK+3]
== MTB_POSITION[POINTER[11:MASK+1]] bits remain unchanged.
This field causes the trace packet information to be stored in a circular buffer of size 2^[MASK+4] bytes,
that can be positioned in memory at multiples of this size. As detailed in the MTB_POSITION description,
typical "upper limits" for the MTB size are RAM_Size/4 or RAM_Size/2. Values greater than the maximum
have the same effect as the maximum.
18.3.1.3 MTB Flow Register (MTB_FLOW)
The MTB_FLOW register contains the watermark address and the autostop/autohalt
control bits.
If tracing is stopped using the watermark autostop feature, it cannot be restarted until
software clears the watermark autostop. This can be achieved in one of the following
ways:
• Changing the MTB_POSITION[POINTER] field value to point to the beginning of
the trace buffer, or
• Setting MTB_FLOW[AUTOSTOP] = 0.
A debug agent can use MTB_FLOW[AUTOSTOP] to fill the trace buffer once only
without halting the processor.
A debug agent can use MTB_FLOW[AUTOHALT] to fill the trace buffer once before
causing the Cortex-M0+ processor to enter the Debug state. To enter Debug state, the
Cortex-M0+ processor might have to perform additional branch type operations.
Therefore, the MTB_FLOW[WATERMARK] field must be set below the final entry in
the trace buffer region.
Chapter 18 Micro Trace Buffer (MTB)
KL02 Sub-Family Reference Manual, Rev. 2.1, July 2013
Freescale Semiconductor, Inc.
233