title: Why does STM32 not interrupt?
body: <p>I am writing a simple program for the microcontroller STM32F407 disk drives. I have already learned how to use timers to delay the execution of a program, but what if I need to start a timer regardless of the main program.
  I try to do everything according to the technical documentation, but the timer overflow interrupt does not work.
  Thanks for the answer anyway!</p>
  
  <pre><code>    #include "stm32f4xx.h"
  #include "stdbool.h"
  
  void clock_perif ();
  void init_HSE ();
  void init_GPIOD ();
  void init_TIM6(int time);
  
  
  #define ledTime 1
  
  int main(void){
      init_HSE ();
  
  
  
  
      __enable_irq ();
      //NVIC_EnableIRQ(TIM6_DAC_IRQn);
      NVIC-&gt;ISER[1] = 0x400000;
  
      clock_perif ();
  
      init_GPIOD ();
      init_TIM6 (ledTime);
  
  
  
      while (1){
      }
  
  }
  
  
  /*
  init RCC
  */
  
  void clock_perif (){
      RCC-&gt;AHB1ENR |= RCC_AHB1ENR_GPIODEN;
      RCC-&gt;APB1ENR |= RCC_APB1ENR_TIM6EN;
      asm("NOP");
      asm("NOP");
      asm("NOP");
      asm("NOP");
      asm("NOP");
      asm("NOP");
  }
  
  
  /*
  Activate external qarzt
  */
  
  void init_HSE (){
       RCC-&gt;CR = RCC_CR_HSEON;
     while (!(RCC-&gt;CR &amp; RCC_CR_HSERDY));
     RCC-&gt;CFGR |= RCC_CFGR_SW_0;
     while (!(RCC-&gt;CFGR &amp; RCC_CFGR_SWS_0));
     RCC-&gt;CFGR &amp;= ~ RCC_CFGR_HPRE_3 | RCC_CFGR_PPRE1_2 | RCC_CFGR_PPRE2_2;
  }
  
  
  /*
  Activate GPIOs
  */
  
  void init_GPIOD (){
      GPIOD-&gt;MODER |= GPIO_MODER_MODE15_0 | GPIO_MODER_MODE14_0 | GPIO_MODER_MODE13_0 | GPIO_MODER_MODE12_0;
      GPIOD-&gt;PUPDR |= GPIO_PUPDR_PUPD15_1 | GPIO_PUPDR_PUPD14_1 | GPIO_PUPDR_PUPD13_1 | GPIO_PUPDR_PUPD13_1;
  }
  
  
  /*
  Timer 6
  */
  void init_TIM6(int time){   
      TIM6-&gt;CR1 |= TIM_CR1_URS | TIM_CR1_UDIS;
      TIM6-&gt;DIER |= TIM_DIER_UIE;
      TIM6-&gt;CNT = 0;
      TIM6-&gt;PSC = 7900;
      TIM6-&gt;ARR = 1;
      TIM6-&gt;EGR = 1;
      TIM6-&gt;SR = 0;
      TIM6-&gt;CR1 |= TIM_CR1_CEN;
  }
  
  
  //Interrupts!
  void TIM6_DAC_IRQHandler (){
      GPIOD-&gt;BSRR |= GPIO_BSRR_BS15 | GPIO_BSRR_BS14 | GPIO_BSRR_BS13 | GPIO_BSRR_BS12;
  }
  </code></pre>
  
  <p>I am new to microcontroller programming and I still have problems</p>