cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f407 routine elapsed time

ASSAAD.ASSAAD
Associate II
Posted on December 04, 2014 at 11:34

Hello  Everyone ;

I am trying to learn the time elapsed for FIR filter with 100 taps in stmd32f407 ; we use keil ; we use simulator of keil in Xtal region should we put the CPU speed clock or the external clock for example in our board we use 8MHZ but we run at speed 168MHZ ; does the keil simiulation time is near to real World?

any other way to learn the elapsed time of a function in real time ? that is important and critical for us .

Thank you

Hector

4 REPLIES 4
Posted on December 04, 2014 at 13:42

The functionality afforded by the Keil simulator is a bit sketchy, especially with PLL/clock settings, you could benchmark speed and extrapolate.

On real systems frankly the easiest method is to use the cycle counter (CYCCNT) in the Data-Watchpoint-Trace (DWT).

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337h/BABJFFGJ.html

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Duration%20of%20FLOAT%20operations&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=4289]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FDuration%20of%20FLOAT%20operations&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=4289

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ASSAAD.ASSAAD
Associate II
Posted on December 04, 2014 at 15:43

Thank you Clive1;

Now I can see that cycle count of my routine ; but what about the real excution time ; 

for example if it 25000 cycle and my MCU running at 168MHZ so how can I calculate the real time ? 

it is important for me because I m sampling at 8khz and doing some filtering so I want to know if my filters routines is less that 125 uS.

Thank you Clive1

Posted on December 04, 2014 at 15:54

DWT_CYCCNT runs directly at the processor's clock, which in 'F4xx is equal to HCLK, your system clock, 168MHz. I.e. you divide the cycle count by 168, and the result is execution time in microseconds.

OTOH, if you will have active interrupts, and/or significant DMA traffic, the results may differ.

JW

ASSAAD.ASSAAD
Associate II
Posted on December 07, 2014 at 19:58

Thank you for help ;

it is really powerfull MCU ; 8 channels norch filter with 350TAPS each in 200 us !

great .