Skip to main content
Visitor II
November 14, 2025
Solved

Sending UART messages between two boards

  • November 14, 2025
  • 6 replies
  • 352 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

    This topic has been closed for replies.
    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

    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

     

    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
    Visitor 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  

    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).

     

    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

    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.

    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.