2025-06-13 8:42 AM
Hello,
I am making a project where i'm using usart2 as a virtual com port and where i'm making a CLI based HMI using teraterm , so there's a lot of diplay and hal_uart_transmit functions , it all worked fine until I added a DMA in the uart1 in order to read gps data.
What happened is that the HMI menu doesn't work as it used to but when i removed the gps reading data part from dma receive to idle it worked like it used to.
Someone told me that using DMA in receive mode like that + Hal_Uart_Transmit causes a block.
Since HAl_uart_transmit is a blocking function, it will cause problems for dma receive ,
And among the problems is that my functions in HMI don't work anymore like they used to, but at the same time i can implement dma with adc and it works fine, the problem is in the uart
Can anyone please explain to me the logic behind it? The issue reminded me of the Hal_delay() block when used inside an interrupt.
You'll find in the first picture how the normal behaviour should be and in the second one what actually happened when dma is also used
2025-06-13 8:58 AM
There are no inherent issues using HAL_UART_Transmit and HAL_UART_Receive_DMA at the same time.
The issues you describe are likely due to a bug in user code, perhaps in how you are using the HAL functions.
2025-06-13 9:00 AM
Hello @imenjazirii
Could share your code please?
2025-06-13 1:04 PM
If you're sending "gps" and not getting anything back, then it's probably has to do how you've set up the DMA.
Show your code.