2020-02-16 07:50 AM
Hello,
I find in HAL_UART_Transmit_DMA the following code:
/* check that tx process is not already ongoing */
if (huart->gstate == HAL_UART_STATE_READY)
{
.....
return HAL_OK;
}
else
{
return HAL_BUSY;
}
As far as I understand gstate, is for both tx and rx, so why we check that it is ready, instead of checking that there is no tx busy ?
Does it mean we can't send during reception of DMA in UART ?
Thank you
2020-02-16 08:11 AM
HW should be capable of full-duplex operation with DMA
2020-02-16 11:31 AM
Examples by Tilen Majerle demonstrate TX and RX DMA simultaneously.
So, yes. But these examples do not use HAL API.
-- pa
2020-02-17 02:02 AM
HAL covers only a small fraction of the features of STM32 MCUs.
All STM32 MCUs have independent DMA channels for UART transmit and receive. Check the DMA request mapping / DMAMUX mapping tables in your reference manual.
DMA for transmit and receive can be enabled/disabled independently, see the DMAT/DMAR bits in UARTx->CR3.