Skip to main content
Visitor II
June 19, 2026
Question

STM32 UART Communication Stops Working After a Few Minutes

  • June 19, 2026
  • 6 replies
  • 152 views

Hello everyone,

I am currently working on an STM32-based project and have encountered an issue with UART communication. The UART works correctly after startup, and data is transmitted and received as expected. However, after running for several minutes, the communication suddenly stops and no further data is received.

I have checked the wiring, baud rate configuration, and power supply stability. I also monitored the application for hard faults but could not identify the root cause. The issue occurs consistently after prolonged operation.

Development Environment:

  • MCU: STM32 Series
  • IDE: STM32CubeIDE
  • Communication: UART

Has anyone experienced a similar issue or can suggest possible causes and troubleshooting steps? Any guidance would be greatly appreciated.

Thank you.

6 replies

Andrew Neil
Super User
June 19, 2026

Welcome to the forum

You need to give some more details about your Project - please see How to write your question to maximize your chances to find a solution for best results.

 

after running for several minutes, the communication suddenly stops and no further data is received.

Received by what?

Is the STM32 receiving, or transmitting ?

What is at the other end from the STM32? How are they connected?

How do you know that the issue is with the STM32 rather than the other end ?

 

What baud rate are you using, and what clock source?

Note that internal RC oscillators are prone to drift…

 

Is your code properly handling UART errors (framing, etc)?

Check for buffer overflows, etc ...

 

Does your code use dynamic memory allocation (eg, malloc) ?

 

What is the state of your code when this happens?

 

PS:

Tips for Debugging - including debugging serial comms.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Pavel A.
June 19, 2026

Often this occurs because of UART RX overrun condition (ORE). It should be properly detected and cleared. 

ST Technical Moderator
June 22, 2026

Hello, 

When overrun occurs in blocking mode, RXNE is no longer set and the driver spins waiting for data that never comes. Error callbacks aren’t called in blocking mode, so the application never recovers.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
Pavel A.
June 22, 2026

So this is one of bugs in the HAL driver. While polling for RXNE it should also check ORE.

In some MCUs the overrun can be disabled, this should be done if the app can’t handle it any better then just clear it.

 

waclawek.jan
Super User
June 22, 2026

Sorry to say this but this whole thread may be bogus. The OP posted another thread (now erased) during the weekend, which containd a blatant spam link, so this thread might’ve been just one to get him enough credits to be able to post the spam.

JW

Pavel A.
June 22, 2026

Ah. Jan you’re right as always.