title: USART3_IRQHandler() is continuously called with LL_USART_IsActiveFlag_TXE set
body: <p>I'm to developing my own serial code (rather than using CubeMX's HAL) to interface an existing protocol codebase which needs low-level serial features.</p>
  
  <p><code>USART3_IRQHandler()</code> is being called repeatedly (and hence <code>serial::serial_irq_handler()</code> too.</p>
  
  <pre><code>/**
    * @brief This function handles USART3 global interrupt.
    */
  void USART3_IRQHandler(void)
  {
    /* USER CODE BEGIN USART3_IRQn 0 */
    serial_irq_handler(&amp;usart3);
    /* USER CODE END USART3_IRQn 0 */
    /* USER CODE BEGIN USART3_IRQn 1 */
  
    /* USER CODE END USART3_IRQn 1 */
  }
  </code></pre>
  
  <p>serial.c:</p>
  
  <pre><code>/**
   * @brief Should be called only by UART/USARTx_IRQHandler()
   */
  void serial_irq_handler(struct serial *serial)
  {
      // "while" is used in case we decide to turn on the limited FIFOs (USARTs only).
      while (LL_USART_IsActiveFlag_RXNE(serial-&gt;usart)) {
          uint8_t b = LL_USART_ReceiveData8(serial-&gt;usart);
          circbuf_push(&amp;serial-&gt;rxcircbuf, b);
      }
  
      if (LL_USART_IsActiveFlag_TXE(serial-&gt;usart)) {
          LL_USART_ClearFlag_TC(serial-&gt;usart);
          serial-&gt;txbusy = 0;
      }
  }
  </code></pre>
  
  <p>(<code>serial-&gt;usart == USART3</code> in the code above.)</p>
  
  <p>I think that the problem is that I am clearing the wrong flag (TC instead of TXE).</p>
  
  <p>Is this the cause of the issue?</p>
  
  <p>I cannot clear TXE, as <code>LL_USART_ClearFlag_TXE()</code> does not exist.</p>
  
  <p>If I comment out <code>LL_USART_EnableIT_TXE(serial-&gt;usart);</code> in the intialisation code, the issue goes away (but I then cannot then see if the serial port is free to write to).</p>