Open tmplt opened 2 years ago
Relevant snippets from documentation:
Also related, on account of the different groupings (singular task events in the first output, back-to-back events in the second output):
Do we see this because state transitions between tracing instances? That is, are we supposed to power cycle the device each time?
Do we see this because state transitions between tracing instances?
This is defenitely the case when using the system clock as the local timestamp clock. Timestamps of an initial exception trace packet wildly differ between resets. This should perhaps be expected?
Iteratively tracing (not powercycling) when using the asynchronous TPIU clock is much more determined: I get the same itm-decode
output each reset.
itm-decode
also yield different timestamps when using different baud rates on the SWO pin, set via SWOSCALER: 1Mbps:
ExceptionTrace { exception: Interrupt { irqn: 12 }, action: Entered }
ExceptionTrace { exception: Interrupt { irqn: 13 }, action: Entered }
LocalTimestamp1 { ts: 25, data_relation: Sync }
DataTraceValue { comparator: 1, access_type: Write, value: [0] }
LocalTimestamp1 { ts: 18, data_relation: Sync }
DataTraceValue { comparator: 2, access_type: Write, value: [0] }
ExceptionTrace { exception: Interrupt { irqn: 13 }, action: Exited }
LocalTimestamp2 { ts: 5 }
ExceptionTrace { exception: Interrupt { irqn: 12 }, action: Returned }
ExceptionTrace { exception: Interrupt { irqn: 12 }, action: Exited }
LocalTimestamp2 { ts: 3 }
ExceptionTrace { exception: ThreadMode, action: Returned }
LocalTimestamp1 { ts: 48, data_relation: UnknownAssocEventDelay }
4Mbps:
ExceptionTrace { exception: Interrupt { irqn: 12 }, action: Entered }
ExceptionTrace { exception: Interrupt { irqn: 13 }, action: Entered }
DataTraceValue { comparator: 1, access_type: Write, value: [0] }
DataTraceValue { comparator: 2, access_type: Write, value: [0] }
LocalTimestamp2 { ts: 1 }
ExceptionTrace { exception: Interrupt { irqn: 13 }, action: Exited }
LocalTimestamp1 { ts: 20, data_relation: Sync }
ExceptionTrace { exception: Interrupt { irqn: 12 }, action: Returned }
ExceptionTrace { exception: Interrupt { irqn: 12 }, action: Exited }
LocalTimestamp1 { ts: 9, data_relation: Sync }
ExceptionTrace { exception: ThreadMode, action: Returned }
With a smaller prescaler more events are then considered to be back-to-back (no idle time) and insight into the exact timestamps of singular events are lost, but a higher throughput increased timestamp qualities are obtained.
But why would timestamp resolution change becauce SWOSCALER
is changed?
With the current implementation reported timestamps are different when
tpiu_baud
changes.With
tpiu_freq = 120000000
andtpiu_baud = 1000000
:With same
tpiu_freq
andtpiu_baud = 4000000
:One would expect timestamps to be the same. On the target, the only difference between the above is the prescaler register:
119
and29
, respectively.