SWO트레이스 출력의 타임 스탬프 해석

기술노트 40349

아키텍처:

ARM

컴포넌트:

debugger

업데이트:

2018-02-28 오전 1:51

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.

죄송하지만, 당사 사이트에서는 Internet Explorer를 지원하지 않습니다.보다 편안한 사이트를 위해 Chrome, Edge, Firefox 등과 같은 최신 브라우저를 사용해 주시길 부탁드립니다.