cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32 uart receive error

Mixolyxo
Associate

Hello. I am getting fault error or uart_waitonflaguntiltimeout error when receiving data from UART via DMA on STM32F4 series microcontrollers when the power of the device on the other side is turned off. What could be the reason for this? What should I do to solve it? Thank you.

3 REPLIES 3
FBL
ST Employee

Hello @Mixolyxo 

 

It would be helpful to share your CubeMX configuration file. You may need to check the DMA initialization. Or you can try GitHub - MaJerle/stm32-usart-uart-dma-rx-tx: STM32 examples for USART using DMA for efficient RX and TX transmission

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!

Thank you. I will try. 

Bob S
Principal

What kind of "fault error"? HAL error code or something like Cortex "hard fault"?  Do you have a HAL_UART_ErrorCallback() function?

When you power off the device at the other end, it will most likely pull its TX line (your RX line) to GND (unless you are using real RS/EIA232 driver/receive chips).  To your UART this looks like either a framing error (missing stop bit) and/or "break" condition (I don't recall if the F4 has "break" detection).  The HAL UART code will terminate the receive process when it sees a framing error.