cancel
Showing results for 
Search instead for 
Did you mean: 

DMA buffer stop filling when RTOEN is enabled UART

Brussl
Associate III

This thread is the follow-up to this thread


Hi, is clear that uart pins are connected , the counter of received bytes is a real value. I try this one:

1. Stop RTOEN interrupt

2. And get interrupt from DMA when buffer is HALF and FULL :

and I have data in DMA buffer:


  huart2.Instance->RTOR = 100;
 // __HAL_UART_ENABLE_IT(&huart2, UART_IT_RTO);
 // huart2.Instance->CR2 |= USART_CR2_RTOEN;

  HAL_NVIC_SetPriority(USART2_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(USART2_IRQn);

 this is in : static void MX_USART2_UART_Init(void)

and :

void DMA1_Stream0_IRQHandler(void)
{
  /* USER CODE BEGIN DMA1_Stream0_IRQn 0 */
  HAL_UART_Transmit( &huart1, dma_buf ,DMA_BUFFER_SIZE , HAL_MAX_DELAY);

  /* USER CODE END DMA1_Stream0_IRQn 0 */
  HAL_DMA_IRQHandler(&hdma_usart2_rx);
  /* USER CODE BEGIN DMA1_Stream0_IRQn 1 */
  HAL_UART_Receive_DMA(&huart2, dma_buf, DMA_BUFFER_SIZE);

  /* USER CODE END DMA1_Stream0_IRQn 1 */
}

this is on DMA interrupt. Then we have data:

 

Brussl_0-1767948660945.png

 

So DMA work , but if i set RTOEN the buffer stops filling.

My MCU is STM32H743VIH6. Uart2 (DMA)  pins are PA3 , PD5

If you can check on some dev. pcb code with this MCU or similar. May be have some problem with memory mapping ? I don't know. DMA received counter work , but nothing in buffer when RTOEN is active. Can you build a project for this MCU to check it here ? 

1 ACCEPTED SOLUTION

Accepted Solutions
Brussl
Associate III

Hello Gyessine, I find problem , but don't know why this is problem at all. When i enable ICache and DCache ,DMA stop writing in buffer. Seems like not access or addressing is missing to buffer in RAM.

Now all work but where is real problem I don't understand.

 

View solution in original post

1 REPLY 1
Brussl
Associate III

Hello Gyessine, I find problem , but don't know why this is problem at all. When i enable ICache and DCache ,DMA stop writing in buffer. Seems like not access or addressing is missing to buffer in RAM.

Now all work but where is real problem I don't understand.