cancel
Showing results for 
Search instead for 
Did you mean: 

UART DMA transmission issue

LOnGr.1
Associate III

1 ACCEPTED SOLUTION

Accepted Solutions
Foued_KH
ST Employee

Hello @LOnGr.1​ ,

DMA1_Stream6_IRQHandler() is an interrupt handler for DMA1 stream 6.It adds a process to clear the transmit completion flag if it is present.

If the flag is not cleared, the next transmission will not be performed.

void DMA1_Stream6_IRQHandler(void)
{
  /* USER CODE BEGIN DMA1_Stream6_IRQn 0 */
  if( LL_DMA_IsActiveFlag_TC6(DMA1) == 1){
    LL_DMA_ClearFlag_TC6(DMA1);
  }
  /* USER CODE END DMA1_Stream6_IRQn 0 */
 
  /* USER CODE BEGIN DMA1_Stream6_IRQn 1 */ /* USER CODE
 
  /* USER CODE END DMA1_Stream6_IRQn 1 */ /* USER CODE
}

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
Foued_KH
ST Employee

Hello @LOnGr.1​ ,

DMA1_Stream6_IRQHandler() is an interrupt handler for DMA1 stream 6.It adds a process to clear the transmit completion flag if it is present.

If the flag is not cleared, the next transmission will not be performed.

void DMA1_Stream6_IRQHandler(void)
{
  /* USER CODE BEGIN DMA1_Stream6_IRQn 0 */
  if( LL_DMA_IsActiveFlag_TC6(DMA1) == 1){
    LL_DMA_ClearFlag_TC6(DMA1);
  }
  /* USER CODE END DMA1_Stream6_IRQn 0 */
 
  /* USER CODE BEGIN DMA1_Stream6_IRQn 1 */ /* USER CODE
 
  /* USER CODE END DMA1_Stream6_IRQn 1 */ /* USER CODE
}

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Foued_KH
ST Employee

Hello @LOnGr.1​ ,

This works perfectly when using the HAL-function HAL_UART_Transmit_DMA().

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Yes, I already used the HAL function before, here I am trying to do it with LL

Hi! Thank you for replying. I am not able to find the function to enable the DMA transfer complete interrupt in the UM (I assume that I have to enbale it).

Here is it

LL_DMA_EnableIT_TC(DMA_TypeDef *DMAx, uint32_t Stream)

you can find this function inside : stm32fxx_it.c

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.