Skip to main content

IAR Embedded Workbench for Arm 10.10.x

Getting started with ITM trace over SWO

In this section:
  1. Before you start C-SPY, choose Project>Options>Driver

    Click the Setup tab or the Connection tab, respectively, and choose Interface>SWD.

  2. After you have started C-SPY, choose ITM Trace Window Settings from the C-SPY driver menu. In the dialog box that appears, make your settings for controlling the output in the Trace window.

    To see statistical trace data, select the option Force>PC samples, see ITM Trace Window Settings dialog box.

  3. To configure the hardware’s generation of trace data, choose ITM Configuration from the C-SPY driver menu. For more information, see ITM Configuration dialog box.

    Note specifically these settings:

    • The value of the CPU clock option must reflect the frequency of the CPU clock speed at which the application executes. Note also that the settings you make are preserved between debug sessions.

    • To decrease the amount of transmissions on the communication channel, you can lower the timestamp resolution by choosing a higher value in the Timestamps>Resolution (cycles) option. Alternatively, set a lower rate for PC Sampling or use a higher SWO clock frequency.

  4. Open the ITM Trace window—available from the C-SPY driver menu—and click EnableButton_Qt_01.pngthe Enable button to enable trace data collection.

  5. Start the execution. The ITM Trace window is continuously updated with trace data. For more information about the window, see Trace window.