Skip to main content
GS1
Senior III
February 24, 2019
Question

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

  • February 24, 2019
  • 2 replies
  • 1179 views

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

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
February 24, 2019

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
GS1Author
Senior III
February 25, 2019

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!