Issue with STM32 UART Communication and Data Loss in Continuous Transmission
I am currently working on an STM32-based project using UART for continuous data transmission between the microcontroller and a PC application.
The system works fine initially, but I am facing intermittent data loss and incomplete packets during long-running communication. The issue becomes more noticeable when the baud rate is increased or when multiple interrupts are active in the system.
What I have already tried:
- Verified baud rate and clock configuration in STM32CubeMX
- Enabled UART interrupt-based receiving
- Increased buffer size for RX handling
- Checked wiring and physical connection stability
Despite this, the problem still occurs randomly after some time of operation.
I would like to ask the community:
- What are the best practices for stable UART communication in STM32 under continuous data flow?
- Should I switch to DMA-based UART instead of interrupt mode for better reliability?
- Are there any known issues with buffer overflow or interrupt priority that could cause this behavior?
Any guidance or real-world experience would be greatly appreciated.
