Skip to main content
Graduate
July 30, 2024
Question

UART Transmission Complete (TC) interrupt generated event if UART is disabled - STM32H7

  • July 30, 2024
  • 0 replies
  • 754 views

If you enable Transmission Complete (TC) interrupt flag TCIE in the UART_CR1 register before enabling UART itself, the interrupt will still be be generated.

It is not possible to clear TC flag using USART_ICR TCCF in such state. The interrupt handler will be invoked infinitely, unless interrupt is disabled back in the CR1 register.

 

Steps to reproduce:

1. Write USART_CR1=0x20000048; Uart is disabled here (UE=0).

2. Enable UARTx_IRQ in NVIC; At this point interrupt handler will be invoked.

3. Inside Interrupt Handler, Try to reset TC flag by writing USART_ICR=0x40; It will fail. TC flag will stay active, application will hang because interrupt handler will be called infinitely.

 

    This topic has been closed for replies.