Skip to main content
Nbkjh.1
Associate II
March 2, 2021
Question

How to manually enabling NVIC irq for timer6 in STM42F407

  • March 2, 2021
  • 3 replies
  • 1862 views

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"

This topic has been closed for replies.

3 replies

KnarfB
Super User
March 2, 2021

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

Nbkjh.1
Nbkjh.1Author
Associate II
March 3, 2021

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

KnarfB
Super User
March 3, 2021

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