MTB_MASTER field descriptions (continued)Field Descriptionpermitted; user write accesses are ignored. The HPROT[1] signal determines if an access is user orprivileged. Note MTB_RAM SFR read access are not controlled by this bit and are always permitted.6TSTOPENTrace stop input enableIf this bit is 1 and the TSTOP signal is HIGH, then the EN bit is set to 0. If a trace packet is being written tomemory, the write is completed before tracing is stopped.5TSTARTENTrace start input enableIf this bit is 1 and the TSTART signal is HIGH, then the EN bit is set to 1. Tracing continues until a stopcondition occurs.4–0MASKMaskThis value determines the maximum size of the trace buffer in RAM. It specifies the most-significant bit ofthe MTB_POSITION[POINTER] field that can be updated by automatic increment. If the trace tries toadvance 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 maximumhave the same effect as the maximum.19.31.3 MTB Flow Register (MTB_FLOW)The MTB_FLOW register contains the watermark address and the autostop/autohaltcontrol bits.If tracing is stopped using the watermark autostop feature, it cannot be restarted untilsoftware clears the watermark autostop. This can be achieved in one of the followingways:• Changing the MTB_POSITION[POINTER] field value to point to the beginning ofthe trace buffer, or• Setting MTB_FLOW[AUTOSTOP] = 0.A debug agent can use the MTB_FLOW[AUTOSTOP] bit to fill the trace buffer onceonly without halting the processor.A debug agent can use the MTB_FLOW[AUTOHALT] bit to fill the trace buffer oncebefore 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 inthe trace buffer region.Chapter 19 Micro Trace Buffer (MTB)KL04 Sub-Family Reference Manual, Rev. 3.1, November 2012Freescale Semiconductor, Inc. 277