Code for enabling Timer4 Interrupt
Using NUCLEO F756ZG & STM Cube IDE
I am trying to setup & enable interrupt for TIM4
The compiler is not happy with these 4 lines of code
TIM4->ARR=5000;
NVIC_SetVector(TIM4_IRQn, (uint32_t)&TIM4_IRQHandler);
NVIC_SetPriority(TIM4_IRQn,0);
NVIC_EnableIRQ(TIM4_IRQn);
TIM4->DIER|=TIM_DIER_UIE;
TIM4->CR1 |= 0x1;
Error#1
for line
NVIC_SetVector(TIM4_IRQn, (uint32_t)&TIM4_IRQHandler);
//NOTE: TIM4_IRQHandler() is declared
it gives this error
../Core/Src/main.c: In function 'main':
../Core/Src/main.c:100:40: error: 'TIM4_IRQHandler' undeclared (first use in this function); did you mean 'RNG_IRQHandler'?
100 | NVIC_SetVector(TIM4_IRQn, (uint32_t)&TIM4_IRQHandler);
| ^~~~~~~~~~~~~~~
| RNG_IRQHandler
Error#2
For lines
NVIC_EnableIRQ(TIM4_IRQn);
TIM4->DIER|=TIM_DIER_UIE;the compiler gives..
Error in final launch sequence:
Setup exceptions
Setup exceptions
I was wondering if any one has encounterd these errors
The Timer4 is he only peripheral I have in my program
Any comments/feedback appreciated
Thanx
Jay
