cancel
Showing results for 
Search instead for 
Did you mean: 

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

IIvan.22
Associate III

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.

 

0 REPLIES 0