Measure Code Execution Time on FRDMK32L3A6 (CortexM4F)

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

Measure Code Execution Time on FRDMK32L3A6 (CortexM4F)

Jump to solution
1,508 Views
Kolibri
Contributor III

Hello i want to measure code execution time of some functions in my implementation. I´m working with the Development Board FRDMK32L3A6 it has an CortexM4F on it.

I want something like:

start_Timer()

Execute code...

stop_timer()

read_timer_value()

Is there a simple way to do this?

Thanks and best regards

0 Kudos
1 Solution
1,505 Views
Kolibri
Contributor III

I´ve found this https://mcuoneclipse.com/2017/01/30/cycle-counting-on-arm-cortex-m-with-dwt/  in the meanwhile and also this https://community.nxp.com/t5/S32K-Knowledge-Base/Measure-the-running-time-of-one-function-on-S32K/ta... and i´ve just tried to search for DWT in the SDK examples of my Board. I activated the Cycle Counter and everything works fine which is pretty nice.

Why stands in the Reference Manual: https://www.nxp.com/webapp/sps/download/preDownload.jsp?render=true on page 318 that the Clock Cycle Counter is not supported?

Thanks and best regards

View solution in original post

0 Kudos
1 Reply
1,506 Views
Kolibri
Contributor III

I´ve found this https://mcuoneclipse.com/2017/01/30/cycle-counting-on-arm-cortex-m-with-dwt/  in the meanwhile and also this https://community.nxp.com/t5/S32K-Knowledge-Base/Measure-the-running-time-of-one-function-on-S32K/ta... and i´ve just tried to search for DWT in the SDK examples of my Board. I activated the Cycle Counter and everything works fine which is pretty nice.

Why stands in the Reference Manual: https://www.nxp.com/webapp/sps/download/preDownload.jsp?render=true on page 318 that the Clock Cycle Counter is not supported?

Thanks and best regards

0 Kudos