Following my question here DMA doesn't copy data from UART RDR , I'm able to receive data from the UART peripheral to the specified buffer.
Now I'm trying to implement the same method described here Efficiently use DMA with UART RX on STM32 but it's not working as expected !.
Precisely, when disabling the DMA enable bit in the CCRx register, the flags (TCIFx, GIFx..etc) don't set and no DMA interrupt is generated.
I did the following test :
I set the RX data size to a small number (4) and then send more than 4 bytes through the UART. A DMA interrupt is generated and goes to the right handler, DMA1_Channel3_IRQHandler in my case.
The HTIF3, TCIF3 and GIF3 are set in the ISR register. until now everything is working as expected.
But when I send only one byte. UART IDLE flag is set, in the USART3_IRQhandler I disable the DMA (CCR3->EN)and expect to have one of the flags HTIF3, TCIF3 or GIF3 set but it is not the case.
PS. The TCIE in the CCR3 is enabled
Here is the UART handler
if((UARTHandle.Instance->ISR & USART_ISR_IDLE) != RESET)
/* Here we disable the DMA stream to trig manually a TC interrupt */ //<-- dosn't work !
I'm using stm32L475 and didn't find any mention of forcing a call transfer complete interrupt by disabling the DMA ?
Any suggestions would be much appreciated!