1

Is there any builtin feature available in Keil uVision to measure execution time of a function or task for STM32F103?

alt-rose
  • 1,441
  • 14
  • 29

2 Answers2

2

Welcome to EE StackExchange.

I'm not familiar with Keil tools, but a quick internet search yields this, so the answer is Yes.

A practical approach would be to use an GPIO and an oscilloscope.

Set the GPIO high when entering you function/task and low when exiting.

Connect the scope probe to the GPIO and you can measure the execution time and frequency of your function/task.

Peter Karlsen
  • 2,024
  • 14
  • 19
1

Sort of...

If you have the TRACESWO pin connected, you can stream limited realtime debug data to keil. One of the things it can include here is the time spent in each ISR.

Also, it is most likely possible to measure performance of threads when using Keils own operating system RTX.

If you own the ULINK Pro, and have the parallel ETM interface wired up, you have a lot more realtime instruction tracing options.

Basically, without TRACESWO you'd have to look into the performance analyzer options of the RTOS in question, or roll your own. Using either a spare timer, or the DWT_CYCCNT.
But an array of GPIO into a logic analyzer works as well.

Jeroen3
  • 21,976
  • 36
  • 73