Skip to main content
Associate II
November 14, 2025
Solved

Sending UART messages between two boards

  • November 14, 2025
  • 6 replies
  • 354 views

Good morning,

I need to connect two h7a3zi-q board via uart (only one way required), but by only connecting tx1->rx2 the programs run but I get empty strings, and by also connecting the grounds of the two boards the tx program gives HardFault. I'm sure of the content of the msgs as I also send via uart3 to my pc and I have no problems. 

Any tips?

Thx

Best answer by Andrew Neil

As always, don't try to do both ends of the link at once !

Get each part working independently, tested against a known-good reference, before bringing them together.

6 replies

mƎALLEm
Technical Moderator
November 14, 2025

Hello,

You can refer to any of the example provided in CubeH7:

https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/NUCLEO-H7A3ZI-Q/Examples/UART

All the examples are using two board connected over UART to transmit messages:

mALLEm_0-1763126579505.png

 

"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."
KnarfB
Super User
November 14, 2025

Showing your code tx/rx loop might help here. Make sure that the rx is always receiving, and you may start by receiving single bytes in an endless polling loop.

hth

KnarfB

Jack_DBAuthor
Associate II
November 14, 2025

Just to make sure, you confirm that connecting the grounds is required? my working theory is that the rx reads only empty strings as it doesn't have a reference value to distinguish 0 bit to 1 bit, but it doesn't explain why the program gives error if the gnds are connected  

mƎALLEm
Technical Moderator
November 14, 2025

@Jack_DB wrote:

Just to make sure, you confirm that connecting the grounds is required? 


It's mandatory.

Refer to the readme file of one of the examples provided above:

mALLEm_0-1763128471582.png

That's not only related to USART but to the most communication interfaces between boards except the differential communication protocols (like CAN for example).

 

"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."
Technical Moderator
November 14, 2025

Hello @Jack_DB 

Please refer to the article below to debug your Hard fault:

How to debug a HardFault on an Arm® Cortex®-M STM3... - STMicroelectronics Community

"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.Saket_Om"
TDK
Super User
November 14, 2025

Connecting GND shouldn't cause a hard fault. If there is a voltage difference between the GND of the two boards, why? How are they connected? USB gnd is generally tied to earth ground, or isolated. Shouldn't be a problem there.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Andrew Neil
Andrew NeilBest answer
Super User
November 14, 2025

As always, don't try to do both ends of the link at once !

Get each part working independently, tested against a known-good reference, before bringing them together.

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.