# Not entering ISR for timer 4 in stm32f4

I have coded for Timer 4 in a STM32f407vg discovery board. But while debugging the control is not entering the ISR. Please find the code below and help:

void InitializeTimer()
{

TIM_TimeBaseInitTypeDef timerInitStructure;

RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE);

timerInitStructure.TIM_Prescaler = 0;

timerInitStructure.TIM_CounterMode = TIM_CounterMode_Up;

timerInitStructure.TIM_Period = 255;

timerInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;
timerInitStructure.TIM_RepetitionCounter = 0;

/*Initialise timer 4 */
TIM_TimeBaseInit(TIM4, &timerInitStructure);
TIM_Cmd(TIM4, ENABLE);

}

void EnableTimerInterrupt()
{

NVIC_InitTypeDef nvicStructure;
nvicStructure.NVIC_IRQChannel = TIM4_IRQn;
nvicStructure.NVIC_IRQChannelPreemptionPriority = 0;
nvicStructure.NVIC_IRQChannelSubPriority = 1;
nvicStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&nvicStructure);
}

void TIM4_IRQHandler(void)
{

if (TIM_GetITStatus(TIM4, TIM_IT_Update) != RESET)
{

TIM_ClearITPendingBit(TIM4, TIM_IT_Update);

}

}


With this configuration I am not able to enter an ISR.

• This is firmware/software, and not about electronics design. It's about the use of a development board. I don't see how it's allowed as on-topic.. Anyway have you asked this on the STM forums? – KyranF Oct 20 '14 at 8:46
• @KyranF Embedded programming at this level has long been held to be on topic here. Chances are that the expertise here is better than in other programming stacks for such questions, and perhaps communicated in a slightly different way for embedded specialties. – Scott Seidman Oct 20 '14 at 12:58
• @ScottSeidman I really feel that we need an embedded programming (microprocessor and single-board computer style size) stack exchange, to bridge the gap between Stack Overflow and EE.SE – KyranF Oct 20 '14 at 13:08
• @KyranF -- clearly agree area51.stackexchange.com/proposals/70800/… – Scott Seidman Oct 20 '14 at 13:13
• @ScottSeidman haha, wow. Okay then. I shall follow it, thanks for the link. – KyranF Oct 20 '14 at 13:30

void TIM_ITConfig(TIM_TypeDef* TIMx, uint16_t TIM_IT, FunctionalState NewState);