Measure code execution time on ARM Cortex-M0 using KDS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Measure code execution time on ARM Cortex-M0 using KDS

1,839 Views
rafaalvescomp11
Contributor II

Good night,

 

I am using the Freedom KL25Z platform and the Kinetis Design Studio (KDS) software.

How can I measure code execution time in KDS?

 

Agradeço desde já,

Rafael

0 Kudos
5 Replies

1,827 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi rafaalvescomp11,

KDS hasn't this function. You use systick to count time or use gpio and oscillator to monitor.

 

Rregards,

Jing

1,798 Views
rafaalvescomp11
Contributor II

Good afternoon,

 

I used a Systick, configured and programmed the Systick according to the images below and the current countdown value was 2410470, how do I convert this value to the execution time?

0 Kudos

1,687 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Systick clock frequency is equal to core clock frequency. For example, if the core run at 48M, the total time is 2410470/48M.

 

Regards,

Jing

0 Kudos

1,643 Views
rafaalvescomp11
Contributor II

Hi Jing,

Dividing 2410470 by 20.97152M which is the system clock I get as a result 0.11 seconds, but wouldn't the execution time of the attached example have to be close to 5s?

 

Regards,

Rafael 

0 Kudos

1,816 Views
rafaalvescomp11
Contributor II

Hi jingpan,

Thank you.

0 Kudos