STM: Difference between revisions

From SEGGER Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 6: Line 6:


STM can be seen as an expansion of the Instrumentation Trace Macrocell (ITM). While ITM focuses on providing a lightweight mechanism for tracing software events, STM extends these capabilities by allowing for more extensive system-level event tracing.
STM can be seen as an expansion of the Instrumentation Trace Macrocell (ITM). While ITM focuses on providing a lightweight mechanism for tracing software events, STM extends these capabilities by allowing for more extensive system-level event tracing.
==How to use with J-Trace Pro==
This section will explain how you can extract STM data from your target device via a [[TPIU]] with a J-Trace Pro.
===Minimum Requirements===
* J-Link Software version V7.94i
* J-Trace Pro V3 or later
* A target device with a [[TPIU]]
===Guide===
The J-Link software currently supports capturing of raw STM data which can be dumped into a file or to a TCP socket.
'''Note:''' The following steps will require setting command strings. How to use command strings in your setup is explained [https://kb.segger.com/J-Link_Command_Strings#Using_J-Link_Command_Strings here].
The setup steps are as follows:
    * Make sure that all board or chip specific init steps (e.g. trace pin init, clock init etc.) are handled either in the target application or via a J-Link Script.
    * Set command string [[J-Link_Command_Strings#CORESIGHT_SetSTMBaseAddr | CORESIGHT_SetSTMBaseAddr ]].
    * Set either [[J-Link_Command_Strings#TRACE_SetSTMDataFile | TRACE_SetSTMDataFile]] path or [[J-Link_Command_Strings#TRACE_SetSTMDataPort| TRACE_SetSTMDataPort]].
    ** Optionally you can change the TraceID we filter for via [[J-Link_Command_Strings#CORESIGHT_SetSTMTraceID| CORESIGHT_SetSTMTraceID]]. (Default trace ID we look for is 0x40.)
    * Now start the trace function (STRACE) in your debug software e.g. Ozone.
If everything worked correctly you should now see the STM data being dumped into the chosen output channel.

Revision as of 09:37, 7 August 2025

General Information

The System Trace Macrocell (STM) is a component within the Arm Coresight technology ecosystem designed to enhance the tracing capabilities of embedded systems. It provides a mechanism for capturing and analyzing system events, allowing developers to gain insights into software behavior, performance, and debugging.

STM is particularly beneficial for real-time applications, as it enables the collection of trace data with minimal impact on system performance. This makes it an essential tool for developers working on complex embedded systems, where understanding the timing and sequence of events is crucial.

STM can be seen as an expansion of the Instrumentation Trace Macrocell (ITM). While ITM focuses on providing a lightweight mechanism for tracing software events, STM extends these capabilities by allowing for more extensive system-level event tracing.

How to use with J-Trace Pro

This section will explain how you can extract STM data from your target device via a TPIU with a J-Trace Pro.

Minimum Requirements

  • J-Link Software version V7.94i
  • J-Trace Pro V3 or later
  • A target device with a TPIU

Guide

The J-Link software currently supports capturing of raw STM data which can be dumped into a file or to a TCP socket.

Note: The following steps will require setting command strings. How to use command strings in your setup is explained here.

The setup steps are as follows:

   * Make sure that all board or chip specific init steps (e.g. trace pin init, clock init etc.) are handled either in the target application or via a J-Link Script.
   * Set command string  CORESIGHT_SetSTMBaseAddr .
   * Set either  TRACE_SetSTMDataFile path or  TRACE_SetSTMDataPort.
   ** Optionally you can change the TraceID we filter for via  CORESIGHT_SetSTMTraceID. (Default trace ID we look for is 0x40.)
   * Now start the trace function (STRACE) in your debug software e.g. Ozone.

If everything worked correctly you should now see the STM data being dumped into the chosen output channel.