AnsweredAssumed Answered

STM32F429 timer debug question

Question asked by Baev.Alexander on Sep 14, 2014
Latest reply on Sep 15, 2014 by sung.chen_chung

Hello friends.

I use EWARM as IDE.

The platform is STM32F429I-DISCO

Now I study timers' behavior. When I use one step through the code while debugging (Step Into in the EWARM) the value of the CNT register changes as it likes. After each step I see absolutely non-related values. Is this because the CLK doesn't stop and the timer continues to increase while the marker is stopped at certain instruction? How can I debug properly?

Here is how I initiate the timer:

RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE);

TIM_TimeBaseInitTypeDef timerInitStructure;

timerInitStructure.TIM_Prescaler = 1000;

timerInitStructure.TIM_CounterMode = TIM_CounterMode_Up;

timerInitStructure.TIM_Period = 0xffff;

timerInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;

timerInitStructure.TIM_RepetitionCounter = 0;

  TIM_TimeBaseInit(TIM3, &timerInitStructure);

  TIM_ITConfig(TIM3, TIM_IT_Update, ENABLE);

   TIM_Cmd(TIM3, ENABLE);

Outcomes