I am using interrupt based UART IO (no DMA).
HAL_UART_Transmit_IT function sets
EIE bit in
CR3 register. According to STM32F407 datasheet (and real behaviour), this generates interrupt only in multi buffer mode (when
DMAR bit is set).
EIE enables interrupt generation for frame error (
FE), overrun error (
ORE), noise error (
NE). This error, as I understand, only for receiving.
HAL_UART_IRQHandler checks for each error. If error occurred and
EIE bit is set, it resets UART state, but doesn't reset interrupt enabling bits, so
TXE interrupt will be always generated, but
UART_Transmit_IT function treats state
HAL_UART_STATE_READY as invalid and doesn't do anything. Infinite loop.
Is it a bug in Cube HAL?