AnsweredAssumed Answered

DWT CycCnt vs SysTick inaccuracy.

Question asked by Jakub Mazur on Jan 17, 2018
Latest reply on Mar 15, 2018 by Jakub Mazur



I'm using PEmicro Multilink Universal debug probe with S32 Design Studio for S32K144 MCU. What I've found out is some inaccuracy between DWT CycCnt and SysTick during single stepping and while using breakpoints:
- when I measure LPIT IRQ intervals by tracing to RAM buffer without any interruptions, both counters show exactly the same amount of ticks elapsed (as expected),
- when I measure the same with stopping on a breakpoint inside LPIT ISR (MCR[DBG_EN]=0), SysTick measurements are 18 ticks bigger than CycCnt,
- when I single step with Instruction Stepping Mode enabled:
  - if CycCnt is increased by 1, SysTick is decreased by 8,
  - if CycCnt is increased by 2, SysTick is decreased by 9.
What could be a reason for these discrepancies?