Cycle-accurate timing measures firmware execution against processor cycles, helping determine whether code is fast enough. On Cortex-M3 and later, the DWT cycle counter provides this measurement; SysTick is a fallback on cores without DWT. Semihosting halts the core and distorts timing measurements, while emulators do not guarantee cycle-accurate timing. section 6.0 section 6.7 section 2.7.1
Choose the measurement path to match the target:
- Use the DWT’s 32-bit CYCCNT counter on Cortex-M3 and later. section 6.7
- Use SysTick’s 24-bit down-counter where DWT is absent; reserve timing-sensitive tests for physical hardware when emulator timing matters. section 6.7 section 2.7.1
