Cycle counter on ARM Cortex M4 (or M3)?

前端 未结 5 1764
陌清茗
陌清茗 2020-12-03 00:13

I\'m trying to profile a C function (which is called from an interrupt, but I can extract it and profile it elsewhere) on a Cortex M4.

What are the possibilities to

5条回答
  •  攒了一身酷
    2020-12-03 00:37

    This depends on you ARM implementation.

    I used the SysTick->VAL register on a stm32F4 core. This is cycle accurate.

    When interpreting the results, take care of:

    • take wrapping into account.
    • It counts down, not up.

    Limitation: This only works on intervals smaller than a single systick.

提交回复
热议问题