Skip to main content
LOnGr.1
Associate III
April 11, 2023
Solved

UART DMA transmission issue

  • April 11, 2023
  • 2 replies
  • 1362 views

This topic has been closed for replies.
Best answer by Foued_KH

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

2 replies

Foued_KH
Foued_KHBest answer
ST Employee
April 11, 2023

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.
LOnGr.1
LOnGr.1Author
Associate III
April 11, 2023

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).

LOnGr.1
LOnGr.1Author
Associate III
April 11, 2023

Here is it

LL_DMA_EnableIT_TC(DMA_TypeDef *DMAx, uint32_t Stream)

Foued_KH
ST Employee
April 11, 2023

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.
LOnGr.1
LOnGr.1Author
Associate III
April 11, 2023

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