cancel
Showing results for 
Search instead for 
Did you mean: 

if i use uart dma channel handler for receiving the data by using the uart i received whole but every byte of data got double why

Asing.3
Associate II

void DMA1_Channel6_IRQHandler(void)

{

 /* USER CODE BEGIN DMA1_Channel6_IRQn 0 */

 /* USER CODE END DMA1_Channel6_IRQn 0 */

 // HAL_DMA_IRQHandler(&hdma_usart2_rx);

 /* USER CODE BEGIN DMA1_Channel6_IRQn 1 */

 /*Checking the proper USART Port*/

  //if (hdma->Instance == hdma_usart2_rx) {

  if (!uartsParam.Rx_Flags) {

  /*Push Rx1_Byte to buffer till stop byte "0x0D"*/

  if (uartsParam.Rx_bytes != 0x0D) {

  uartsParam.Rx_Frame_Byte_Uarts[uartsParam.rx_count_Uarts] =uartsParam.Rx_bytes;

  uartsParam.rx_count_Uarts++;

    HAL_DMA_IRQHandler(&hdma_usart2_rx);

    HAL_UART_Receive_DMA(&huart2,&uartsParam.Rx_bytes,1);

  } else if(uartsParam.Rx_bytes==0x0D){

  uartsParam.Rx_Frame_Byte_Uarts[uartsParam.rx_count_Uarts] = uartsParam.Rx_bytes; /*Pushing the Stop Byte into the Buffer*/

  uartsParam.Rx_Flags = 1;

  }

  }

 /* USER CODE END DMA1_Channel6_IRQn 1 */

}

1 REPLY 1

Which STM32?

What are the symptoms?

Read out and check/post the USART and DMA registers content.

JW