2021-06-23 01:34 AM
I am using STM32H7B0VBT6 MCU.
i want to transmit data using UART with DMA in normal mode.
i am using "HAL_UART_Transmit_DMA(&huart4, &UART4_array[0], UART4_ARRAY_SIZE);"
it sends only once , next time it do not work. Where i am doing wrong ? am I using wrong syntax ?
Please help me.
Solved! Go to Solution.
2021-06-23 12:26 PM
Hello @NKann.1 ,
Please consider the following example and article:
Hope this helps you :)
Imen
2021-06-23 12:26 PM
Hello @NKann.1 ,
Please consider the following example and article:
Hope this helps you :)
Imen
2021-06-23 09:54 PM
Thanks a lot Imen DAHMEN
2021-06-24 03:34 AM
You are welcome :)
2023-09-14 05:06 AM
Dear @NKann.1 , I facing the same problem with stm32h725ze. I've tried to implement the suggested solutions but nothing was effective... The strange thing is that configuring DMA as circular the communication runs...
How did you solve your issue in this case?
2023-09-14 05:17 AM
To transmit USART/UART with DMA using HAL, you need to enable the global interrupt for the USART/UART you are using. This is necessary because the HAL library, when using DMA, sets huart->gstate to HAL_UART_STATE_BUSY_TX and does not set it back to HAL_UART_STATE_READY. You can do this manually or enable UART global interrupts automatically by configuring NVIC settings in your .ioc file.
2023-09-14 05:38 AM
Thanks @Juanjo97 , now it's working!
2023-09-30 09:18 PM - edited 2023-09-30 09:21 PM
Try my new multi-port uart dma library which works on f1,f4,h7 and can be easily modified through defines to support more series: https://github.com/georgy-moshkin/stm32uart
Configure UART ports using stm32cubeide, enable global interrupts, dma, and circular mode for RX channel. Use COM_Init with HAL's huart1, huart2, etc. pointers and you can start sending/receiving from multiple uart ports using simple functions.
Tutorial on how to use can be found here: https://youtu.be/ZlsmW7s1N10
2024-04-05 01:07 AM
Thank you for this
2024-08-11 11:34 PM
Why do we need to set gstate to HAL_UART_STATE_READY ,in uart isr ? because if we use dma for uart tx, lets say we have 100bytes to transfer, after we sent data uart tx isr will be triggered after the 1st byte of the data , shouldnt it be HAL_UART_STATE_BUSY_TX untill the last byte ?