Skip to main content
Visitor II
July 29, 2025
Question

STM32 not receiving properly from Arduino using UART

  • July 29, 2025
  • 3 replies
  • 374 views

 

I'm implementing UART communication between an Arduino Uno and an STM32L476RG. When the STM32 acts as the master (transmitter) and the Arduino Uno as the slave (receiver), data transmission works as expected. However, when I reverse the roles—making the STM32L476RG the slave (receiver) and the Arduino Uno the master (transmitter)—the STM32 fails to receive data correctly. I'm looking for a reliable solution to ensure proper UART communication in this configuration.

    This topic has been closed for replies.

    3 replies

    Super User
    July 29, 2025

    Welcome to the forum.

    Please see How to write your question to maximize your chances to find a solution for best results.

    In particular, please give details of your hardware, your code, and what tools you're using.

     


    @pari wrote:

    the STM32 fails to receive data correctly. .


    What does that mean, exactly: it receives nothing? receives junk? receives partial data? other?

    How are you sure that your Arduino is transmitting correctly?

     

    It's generally better to test against a terminal on a PC - then you remove all the unknowns of your code on the Arduino.

     

     


    @pari wrote:

    I'm looking for a reliable solution to ensure proper UART communication in this configuration.


    A common approach is to have the UART receive under interrupt to a ring buffer, and your main loop processes the data from that buffer.  (this is what the Arduino does internally).

     

    PS:

    There's a bit more detail here of how the Arduino Serial works "under the hood" - including use of interrupts & ring buffers.

    Technical Moderator
    July 31, 2025

    Hello @pari 

    Did you check if the data is being sent by the master using logic analyser ?