cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid Underrun Error in USART Synchronous reception (Slave Mode)

GS1
Senior III

Hi all,

I still have trouble connecting my 2 STM32H7 in USART Synchronous mode. When receiving a message in Interrupt or DMA mode ( I don't need to transmit something) I always get Error Code x11 = Underrun Error. As I understood this is due to the fact that my transmit buffer is empty.

How can I just start the slave reception without this issue?

The USART currently runs at 2.5 MBit. In Polling Mode the data is received correctly. But I need DMA Mode.

Any suggestions are very welcome

2 REPLIES 2

I don't know what's Error Code x11 (some cuboid maybe?), but does underrun error occur if you don't set USART_CR1.TE?

JW

GS1
Senior III

Hi Jan,

Error Code 0x11 is the code for "Underrun Error" (seen in the HAL definition).

I use STM32CubeMX and the HAL_ routines (like HAL_USART_Receive_IT) and simply wait for the Master to send the data. I don't use the direct register access.

But this error even occurs if I use an empty buffer for transmission and call HAL_USART_TransmitReceive_IT (as Slave!). As nothing worked with the synchronous communication and I have to get my job done, I switched to the Asynchronous UART communication and this works for me currently even with 12.5 MBit. It seems that the Synchronous Mode might only be working with an SPI receiver?

But thank you anyway for your post!