cancel
Showing results for 
Search instead for 
Did you mean: 

Why did the process of adding the breakpoint affect hardware timer?

wailker3
Visitor

Hello,

  I am using STM32F103 and CubeIDE software for a time measurement project. In the capture interrupt function of the external signal, I obtain the value(CNT) of the timer to calculate the interval time between signals. And I use STLINK V2 to debug my program (SWD).

  While I was debugging my program, I found that no matter where I add the break point, the interval time would change. In other words, the process of adding breakpoints during debugging affected the operation of timer. This does not occur in Keil.

 Please provide me with a solution. Because I don't want to give up using CubeIDE.

 

  

1 REPLY 1
TDK
Super User

There's a setting to freeze the timers when the core is halted if that's what you want. Look at the DBG_TIMx_STOP bits in the Reference Manual.

If you feel a post has answered your question, please click "Accept as Solution".