Instruction Trace Overview
What is Instruction Trace?
Red Suite 5 adds new trace functionality to complement the Serial Wire Viewer (SWV) Red Trace capabilities provided in earlier releases of Red Suite. This new Instruction Trace functionality provides the ability to record a trace of executed instructions on certain Cortex-M0+, M3 and M4 based MCUs.
In addition support for Instruction Trace is also provided in LPCXpresso 5 (which does not support Red Trace (SWV)).
For more information on Red Trace (SWV), please see the FAQ Red Trace Overview.
Which MCU's are supported by Instruction Trace?
Cortex M3/M4 parts
To support the use of the Instruction Trace functionality within the Code Red IDE, the target MCU must implement both an Embedded Trace Macrocell (ETM) AND an Embedded Trace Buffer (ETB). This means, for example, that Instruction Trace can be carried out with NXP's LPC18xx and LPC43xx parts, but not with LPC17xx parts (which do not implement an ETB).
Cortex M0+ parts
To support the use of the Instruction Trace functionality within the Code Red IDE, the target MCU must implement a Micro Trace Buffer (MTB). This means, for example, that Instruction Trace can be carried out with NXP's LPC8xx parts and Freescale's Kinetis KLxx parts.
Below is a list of the currently supported targets and their trace buffers.
- LPC8xx (MTB)
- LPC18xx (ETM / ETB)
- LPC43xx (ETM / ETB)
- Kinetis L Series (MTB)
- Kinetis K Series (ETM / ETB)
Note that Instruction Trace can be used with both SWD and JTAG debug connections (where supported by the target MCU).
Do I need any additional hardware to use Instruction Trace?
Use of Instruction Trace requires connection to the target MCU using a compatible debug probe. This includes Code Red’s Red Probe, Red Probe+, NXP LPC-Link and the Freescale FRDM board's built-in "Redlink" probe. No additional external "trace buffer" unit is required, as the ETB/MTB within the MCU is used to collect the instruction trace records.
Can I use it with an evaluation licence?
You can use Instruction Trace with an evaluation licence on Freescale M0+ parts. A full licence is required to use it with other targets.
Can Instruction Trace be started without pausing the target?
In order to begin collecting instruction trace records, execution of the target MCU must be paused. It must be paused again to download the trace records for display within the debugger.
On some parts Instruction Trace can be conditionally enabled to allow trace collection in a focal area of your code. This usage only requires the target to be paused once to program the target for instruction trace and once to collect the data at some point in the future, allowing useful Instruction trace with minimal interruption of the target.
Target clock speed
There are no constraints or setup issues related to clock speed when using Instruction Trace.