Skip to main content
Visitor II
October 28, 2024
Solved

UART communication between Raspberry Pi 4 and stm32f411re

  • October 28, 2024
  • 4 replies
  • 3655 views

Hi, i want the communication between stm32f411re board and raspberry pi 4. i tried to do with uart2 through USB cable it is working fine. but sometimes it is not able to communicate properly. there is a delay while communicating sometimes. will i2c or spi communication works with USB cable to communicate. which is better and i want the one efficient to work as i want both ways communication.

    This topic has been closed for replies.
    Best answer by suhfi

    Okay sure, the problem is with the delay in the communication of stm32 Nucleo board and raspberry pi through UART. but later i have understood that the delay is not with the communication but with the motors drivers and working of that. Thank you for your time.

    4 replies

    Super User
    October 28, 2024

    @suhfi wrote:

     sometimes it is not able to communicate properly. there is a delay while communicating sometimes


    There no inherent reason why that should happen with a UART connection.

    You need to find out what's causing this delay - it must be something elsewhere in your system.

    Changing to some other transport won't fix that.

     

    Have you tried using the Raspberry Pi's hardware UART ?

     

    PS:

     


    @suhfi wrote:

     uart2 through USB cable 


    Please give more details of that.

    I assume you mean a USB-to-UART cable/adaptor somewhere?

    https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

     

    suhfiAuthor
    Visitor II
    October 28, 2024

    No, i didn't do the communication by connecting the gpio pins, but from the usb cable. there is a delay for sure. i didn't mention any delay with that, then why am i facing delay with the comunication.

    Super User
    October 28, 2024

    @suhfi wrote:

     i didn't do the communication by connecting the gpio pins, but from the usb cable. 


    Again, you need to give more details.

    How, exactly, are you making this USB connection?

    Show a schematic.

    Post photographs.

    What, exactly, is the "stm32f411re board" you are using?

    Is it still the same as this:

    https://community.st.com/t5/stm32-mcus-products/communication-between-nucleo-f411re-and-raspberry-pi-using-st/m-p/721443

     

    Technical Moderator
    October 28, 2024

    Hello,

    Related to this thread: https://community.st.com/t5/stm32-mcus-products/communication-between-nucleo-f411re-and-raspberry-pi-using-st/td-p/721443

     


    @suhfi wrote:

    but sometimes it is not able to communicate properly. there is a delay while communicating sometimes. 


    Need to clarify this statement. From which side? STM32 delays the transmit or Raspberry-Pi?

    Super User
    October 28, 2024

    @mƎALLEm wrote:

    Need to clarify this  statement. From which side? STM32 delays the transmit or Raspberry-Pi?


    Indeed.

    @suhfi Also, how much of a delay is it?

    How do you observe this delay?

    Super User
    October 28, 2024
    suhfiAuthor
    Visitor II
    October 28, 2024

    Thank you for the replies, i did solve the problem.

    Super User
    October 28, 2024

    @suhfi wrote:

    Thank you for the replies, i did solve the problem.


    Great - so, for the benefit of future readers, what was the problem?

    Please describe how you solved it, and then mark that as the solution:

    https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256

    suhfiAuthorAnswer
    Visitor II
    November 5, 2024

    Okay sure, the problem is with the delay in the communication of stm32 Nucleo board and raspberry pi through UART. but later i have understood that the delay is not with the communication but with the motors drivers and working of that. Thank you for your time.