Skip to main content
Visitor II
March 18, 2025
Question

UART not receiving while transmitting with another

  • March 18, 2025
  • 3 replies
  • 555 views

Hello,

 

I am using STM32F407 Transmitting some data over UART and Receiving the same data with another in INT on the MCU.

The problem is that the receiving side gets only the first byte even when switching sides the receiving side still receives only the first byte.

 

I think that the HAL stops receiving data on all UARTS while transmitting.

This topic has been closed for replies.

3 replies

TDK
March 18, 2025

Show your code.

If you want to receive UART data while also sending, you will need to use IT or DMA functions to receive.

"If you feel a post has answered your question, please click ""Accept as Solution""."
KnarfB
Super User
March 18, 2025

Show the relevant code snippets. Do error checking for all function calls.

hth

KnarfB

Andrew Neil
Super User
March 18, 2025

@Omar-AbdulQadir wrote:

I think that the HAL stops receiving data on all UARTS while transmitting.


As the others have said, show code which demonstrates this.

See: How to insert source code and How to write your question to maximize your chances to find a solution.

 

You understand that the HAL provides both blocking ("synchronous") and non-blocking ("asynchronous") methods?

As @TDK said, you will need to use the non-blocking methods (interrupts, DMA) to do both transmitting and receiving at the same time.

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.