title: Problem enabling a NVIC IRQn channel in the STM32F407
body: <p>I am trying to use the NVIC controller to see when the data is available from a peripheral. The peripheral is connected to an external interrupt line through a GPIO port pin. I have configured this pin to work as an external interrupt and from has an interrupt number equal to IRQn (as seen in the functions).</p>
  
  <pre><code>HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); //This has all 4 bits as preemption priority bits
  HAL_NVIC_SetPriority(IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(IRQn);
  </code></pre>
  
  <p>The problem lies when I am trying to use the function below</p>
  
  <pre><code>HAL_NVIC_GetPendingIRQ(IRQn)
  </code></pre>
  
  <p>My code will still run because when an interrupt is not active it is still in the pending state. I don't know if the problem may exist inside the processor and some configurations I am missing. Online I find that the previous lines are enough to implement the NVIC but it does not work.</p>
  
  <p>PS: This is programmed in the C language and I am using the HAL driver macros and functions as you can see by the HAL- prefix. Additionally, when polling to this specific external interrupt line, it works fine
  i.e.</p>
  
  <pre><code>__HAL_GPIO_EXTI_GET_IT();
  </code></pre>