Interpreting time stamps in SWO trace output

Technical Note 40349

Targets:
ARM

Component:
Debugger

Updated:
11/24/2008 10:44 AM

Introduction

This Technical Note illustrates how to interpret timestamps in SWO trace output for IAR Embedded Workbench for ARM version 5.20, using a simple example.

Background

  • A target hardware system is running with 72 MHz system clock.
  • C-SPY is connected with a debug probe, using SWD.
  • Exceptions are traced (SWO Setup).
  • Time stamps are enabled with resolution 16.
  • In the trace below, letters A,B,C,D have been added to represent the cycle values that are connected to the exception that just happened.

Edited trace example

Index   SWO Packet   Cycles       Event                     Value  
+-------+------------+------------+-------------------------+------------+
006657 0E0F20 122725344 Exit Exception Number 15
006658 20 122725376 Timestamp synch 2
006659 0E0030 122725376 Return to Exception Number 0
006660 0E0F10 122725376 Enter Exception Number 15
006661 C09323 122797360 A Timestamp synch 4499
006662 0E0F20 122797360 Exit Exception Number 15
006663 10 122797376 B Timestamp synch 1
006664 0E0030 122797376 Return to Exception Number 0
006665 0E0F10 122797376 Enter Exception Number 15
006666 C09323 122869360 C Timestamp synch 4499
006667 0E0F20 122869360 Exit Exception Number 15
006668 20 122869392 D Timestamp synch 2
006669 0E0030 122869392 Return to Exception Number 0

Example calculations

Running exception 15

B - A = 122797376 - 122797360 = 16
16/72 ~ 0.22
The time from A to B is approximately 0.22 us.

Running main program

C - B = 122869360 - 122797376 = 71984
71984/72 ~ 999.78
The time from B to C is approximately 999.78 ms.

Running exception 15

D - C = 122869392 - 122869360 =
32/72 = 0.44
The time from C to D is approximately 0.44 us.

Comments

Since the resolution is set to 16, the real time spent in the 2 exceptions is somewhere between 0.22 and 0.44 us.

To measure it more exactly, you could use timestamp resolution 1. In the example, it seems that exception 15 is a 1 ms periodic interrupt. (Note that the Interrupt Log, Interrupt Log Summary and Timeline windows can be used to see time in us/ms format).

 

All product names are trademarks or registered trademarks of their respective owners.

Related Tech Notes

© IAR Systems 1995-2016 - All rights reserved.