How do I process just UART RX interrupt events while using HAL_UART_Transmit_DMA
Hi,
I am working with F413 and I am using USART3 to receive and trasmit data over UART. As I need to receive unknow size of data I wrote my own interrupt handler for RX. However I would like to transmit data out with a help of DMA.
If I call regular poll UART_Transmit(...) function, device will send out data and response from the target will be picked up by RX IRQ handler to a buffer without a problem. I wan't to get rid of blocking UART_Transmit() function. For that reason I configure and setup DMA so I could use non-blocking UART_Transmit_DMA(...) function.
With logic analyzer I can see properly formed outgoing and incoming traffic. I would say that DMA transmit works fine... but now I have problem with RX IRQ handler...
My receive IRQ handler looks like this:
/* USART3 RX handler */
UART_RX_INTERRUPT_HANDLER_DECLARATION(USART3)
{
/* Check if receive register is not empty status */
if __HAL_UART_GET_FLAG(&UARTS_Instance()->consts[UART_INSTANCE_3].huart, USART_SR_RXNE)
{
/* Disable/ clear flag */
__HAL_UART_CLEAR_FLAG(&UARTS_Instance()->consts[UART_INSTANCE_3].huart, USART_SR_RXNE);
/* Process received data */
UARTS_Instance()->rx_irq_callback(UARTS_Instance()->consts[UART_INSTANCE_3].index ,__HAL_UART_FLUSH_DRREGISTER(&UARTS_Instance()->consts[UART_INSTANCE_3].huart));
/* Flush register*/
__HAL_UART_FLUSH_DRREGISTER(&UARTS_Instance()->consts[UART_INSTANCE_3].huart);
/* Re-enable interrupt */
__HAL_UART_ENABLE_IT(&UARTS_Instance()->consts[UART_INSTANCE_3].huart, UART_IT_RXNE);
}
} What happens now is that I am stuck in this handler and it gets called repeatedly, therfore my program "freezes". If I put breakpoint inside handler and inspect peripheral registers I see there's TCIE register enable.... although I never enable it manually anywhere in my code ( I've checked it several times)... So now I am thinking if DMA could have any impact on that and how I should properly handle flags and interrupts within that handler (while DMA Stream has it's own handler - HAL_DMA_IRQHandler(&dma) ).

void DMA1_Stream3_IRQHandler(void)
{
HAL_DMA_IRQHandler(&UARTS_Instance()->consts[UART_INSTANCE_3].hdma);
}Any help would be much appreciated!
