STM32F4xx HAL dumps RAM through UART on Framing Error? (possible security issue)
I am using DMA for receiving data, but interrupts for transmitting over UART and I am experiencing following issue:
When the UART experiences Framing Error, the DMA stream triggers an interrupt to which HAL responds by eventually calling UART_DMAAbortOnError() which will zero both RX and TX transfer counters, but does not terminate the Interrupt driven transmission properly. If this happens during a transmission the UART interrupt handler calls UART_Transmit_IT() which contains following boundary check:
if (--huart->TxXferCount == 0U)But the TxXferCount was set to 0 by the UART_DMAAbortOnError(), so the counter will wrap around and the UART will effectively dump half of the RAM.
Does anybody know the correct work-around, beside modifying HAL code?
Thanks
