cancel
Showing results for 
Search instead for 
Did you mean: 

UART communication between Raspberry Pi 4 and stm32f411re

suhfi
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

11 REPLIES 11

@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

 

SofLit
ST Employee

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?

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.

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.


@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

 


@suhfi wrote:

i didn't mention any delay with that, 


With what, exactly?


@suhfi wrote:

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.


Need also to post your code

+ Show how you did connect the Nucleo board with the Raspberry board.. Share photo(s).

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.
suhfi
Senior

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


@SofLit 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?