Can we send and receive DMA UART at the same time ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-16 7: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
- Labels:
-
DMA
-
STM32Cube MCU Packages
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-16 8:11 AM
HW should be capable of full-duplex operation with DMA
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-17 2: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.
