cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 problem with UART RX throught DMA

Smark
Visitor

Hello,

I am implementing the use of the DMA for receiving data from the UART on a board with an STM32G491 that is constantly receiving data at 19200 baud.


The DMA is configured in normal mode, and the receive buffer is currently of 50 bytes.


Each time the buffer fills up, in the HAL_UART_RxCpltCallback interrupt I enable a flag to handle data in the main loop and in the same interrupt I call HAL_UART_Receive_DMA to re-enable reception.


The problem comes when in this call returns HAL_BUSY because the DMA reception is blocked waiting for HAL_UART_Receive_DMA to be called again to restart the reception.

I don't understand why I get this response (HAL_BUSY), nor how to deal with it.

If I configure the DMA in circular mode I always receive the HAL_BUSY response and therefore the reception does not work.

Any idea what I can be doing wrong?

Thanks in advance,

 

 

0 REPLIES 0