cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 HAL USART DMA hangs after first byte

vrouesnel
Associate II
Posted on March 02, 2015 at 13:36

I can receive one byte over DMA, but then thats it. What is the correct way to use the DMA USART - its not obvious. I am using FreeRTOS.

Here is my code:

```

void task(void) {

  status = HAL_UART_Receive_DMA(&huart1, (uint8_t *) aRxBuffer, RXBUFFERSIZE);

  while (1) {

    status = HAL_UART_Receive_DMA(&huart1, (uint8_t *) aRxBuffer, RXBUFFERSIZE);

  }

}

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {

  HAL_StatusTypeDef status;

  uint8_t data;

  osMessagePut(usartQueue, aRxBuffer[0], 0);

  //status = HAL_UART_Receive_DMA(&huart1, (uint8_t *) aRxBuffer, RXBUFFERSIZE);

  //if (status != 0) __BKPT(0);

}

```

Any ideas?

Thanks!
0 REPLIES 0