AnsweredAssumed Answered

STM32F4 HAL USART DMA hangs after first byte

Question asked by pinkman on Mar 2, 2015
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!

Outcomes