2017-10-19 03:25 AM
How can I know the elapsed time between breakpoints in EWARM?
Solved! Go to Solution.
2017-10-19 06:37 AM
On a general note, I think the core has a CYCLECOUNT register which needs to be enabled. By substracting the values between breakpoints (or even stored on a global variable), knowing the core clock frequency can yield the time between two points in the code. (with global variable, max value can be also tracked over some operating time). For IAR specifics, don't know.
2017-10-19 06:37 AM
On a general note, I think the core has a CYCLECOUNT register which needs to be enabled. By substracting the values between breakpoints (or even stored on a global variable), knowing the core clock frequency can yield the time between two points in the code. (with global variable, max value can be also tracked over some operating time). For IAR specifics, don't know.
2017-10-19 09:54 AM
Yes, ST's M3 and M4 designs have the DWT_CYCCNT, one could use the BKPT instruction and time tag specific points in the code, and report the delta time in R0, for example.
2017-10-20 05:43 AM
Dear Mr./Ms. KIC8462852 EPIC204278916
Thank you for your reply. I found
CYCLECOUNT register. I enabled the CYCLECOUNT register by setting the DWT Control register's CYCNTENA bit (DWT_CTRL.CYCNTEN) to 1.
But I have something I can not understand. I made a program that flashes the LED by TIM counter overflow every 500 ms. Below is the interrupt part of the program. I set a breakpoint here.
And as shown in the picture below, I was able to get CCSTEP = 134.
But what does this 134 mean? I am using STM32F401RETx Nucleo-F401RE, and SYSCLK is 84MHz.
So, 134/(84*10^6)=1.595us. I want this answer to be 500 ms.
Best Regards,
Ken Inoue
2017-10-20 05:53 AM
Dear Mr./Ms. Clive One
Thank you for your reply. First, I would like you to see my answer to Mr./Ms.KIC 8462852 EPIC 204278916. As written there, I made a program that flashes the LED by TIM counter overflow every 500 ms. And I got the picture below.
what does this 134 mean?
Best Regards,
Ken Inoue