UART using DMA communication problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-04-11 6:32 PM
Hello,
I'm posting a question to get advice on a problem about communication with UART using DMA.
I wrote code like followings : Transmit data only when HAL_DMA_STATE is ready.
if(HAL_DMA_GetState(hdma) == HAL_DMA_STATE_READY)
HAL_UART_Transmit(huart, msg, len);
During the experiment for several UART ports, the port using DMA1 Stream operated normally.
But the port using DMA2 Stream found a problem that data could not be transmitted.
During finding cause of this problem, It was confirmed that HAL_DMA_STATE is maintained in Busy state, after sending data for the first time.
How can I solve the problem that HAL_DMA_STATE of DMA2 not returning to Ready and remaining Busy?
<Note>
- After setting the MCU through CubeIDE, the code is generated using 'Generate Code'
- All global interrupts are enabled in 'NVIC Settings' of UART/USART ports
- The 'MX_DMA_Init()' function is located just below the 'MX_GPIO_Init()' function.
- MCU is STM32F767ZITx
- Labels:
-
DMA
-
STM32F7 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-04-12 4:04 AM
I solved this by changing the pinout settings.
