Skip to main content
Associate
February 23, 2026
Question

transmit and receive messages using usart?

  • February 23, 2026
  • 2 replies
  • 179 views

Hello
I want to create sort of application that transmit and receive messages between 2 STM32F407 DISC0 and echo the transmited and received messages in PC screen(sort of chatbox)
any hints how can I do it?
and is it easier using USART or SPI?

2 replies

Andrew Neil
Super User
February 23, 2026

Of course, transmitting and receiving messages is exactly what UARTs are for!

You will need:

  1. One UART on each Disco board for the communication between boards;
  2. One UART for the communication between the Disco board and PC
    (one UART on each board of you want both of the boards to be connected to a PC)
 

Image1.png

 

PS:


@avatar_ang wrote:

and is it easier using USART or SPI?


That depends on how familiar you are with SPI...

Connecting to a PC is certainly easier via UART.

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.
Visitor II
February 23, 2026

The simplest PC side would use UART to USB adapter cables and either  two Terminal programs in the PC or one terminal program in each of two PCs.

Andrew Neil
Super User
February 23, 2026

@Hal3 wrote:

The simplest PC side would use UART to USB adapter cables 


Simpler still: the VCPs in the ST-Links on the Disco boards.

Except that @avatar_ang seems to be using STM32F407G-DISC1  - where the VCP is not connected.

 

@avatar_ang if you're specifically wanting to do UART comms with PCs, it would make a lot more sense to choose a different board which does have a working VCP.

eg, NUCLEO-F411RE if you want to keep in the F4 family ...

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.