cancel
Showing results for 
Search instead for 
Did you mean: 

How to manually enabling NVIC irq for timer6 in STM42F407

Nbkjh.1
Associate II

Hello, i have written the following code for interrupt delay based on timer as shown in the attached file

But Keil shows the error bellow on the line.

Why it gives me such error,how do i manually enable the IRQ of TIM6?

Thanks,

 NVIC_EnableIRQ(TIM6_IRQn);

../Core/Src/main.c(124): error: #20: identifier "TIM6_IRQn" is undefined"

3 REPLIES 3
KnarfB
Principal III

Its called TIM6_DAC_IRQn. Don't you use auto-completion?

Nbkjh.1
Associate II

Why it involves DAC i just want it to call the interrupt whenever there is an overflow in the counter.

KnarfB
Principal III

The total number of interrupts is limited. Chip vendor decided to share these two. That's also why the interrupt handlers have to check flags to find out the interrupt source (if you use both). HAL does handle it for you. If you don't use HAL you are on your own. If you don't use DAC you don't need to worry or care.

hth

KnarfB