Disabling DMA has no effect on DMA transfer compelete flag (TCIF)
Hello,
Following my question here
https://community.st.com/0D50X00009XkWuQSAV
, 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
https://community.st.com/0D50X00009XkW2nSAF
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
void USART3_IRQHandler(void)
{ if((UARTHandle.Instance->ISR & USART_ISR_IDLE) != RESET) {__HAL_UART_CLEAR_IDLEFLAG(&
UART
Handle);/* Here we disable the DMA stream to trig manually a TC interrupt */ //<-- dosn't work !
__HAL_DMA_DISABLE(UART
Handle.hdmarx); }}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!
#stm32f457 #uart-interrupt #dma-uart