2023-10-19 01:04 AM
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.
2023-10-19 01:29 AM
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.
2023-10-19 02:08 AM
Thank you. I will try.
2023-10-19 02:22 PM
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.