Implement UART Transmit in DMA mode correct way
I am using stm32f779I eval kit. I am using example UART_HyperTerminal_DMA by en.stm32cubef7.
I am trying to implement UART in DMA mode to transmit a simple string.
So I have used CubeMX to generate the code and I have configured UART1 TX DMA in normal mode.
Whenever I run the code in debugging mode, I see the first time I attemp to send the string, it works ok and sends the string.
But I couldn't send a second transmission.
Can any one please suggest the correct way to use Uart Tx in DMA mode? How can I send successive strings one after another?
E.g. :
i used
if(HAL_UART_Transmit_DMA(&UartHandle, (uint8_t*)aTxStartMessage, TXSTARTMESSAGESIZE-10)!= HAL_OK)
{
/* Transfer error in transmission process */
Error_Handler();
}
if(HAL_UART_Transmit_DMA(&UartHandle, (uint8_t*)aTxStartMessage, TXSTARTMESSAGESIZE-10)!= HAL_OK)
{
/* Transfer error in transmission process */
Error_Handler();
}
2 times HAL_UART_Transmit_DMA() API. 2nd time API has huart->gState == HAL_UART_STATE_BUSY_TX
