Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 11 months ago.
How can I read the cycle counter on my Nucleo stm32f401re board.
I'd like to measure how many cycles are required for a specific operation. Is there a free running cycle counter available?
1 Answer
9 years, 11 months ago.
There is no direct cycles counter. You can use one of the 32 bit timer. They can be clocked internal divided by 1 to use the same frequency as the cpu. The timers are complex to setup. Import the mbed-src lib. You can find the documented cmsis timer files in stm32f4xx_hal_tim.c Also consult the RM0368 Reference manual.