cancel
Showing results for 
Search instead for 
Did you mean: 

Communication between Nucleo-F411RE and Raspberry Pi using ST-Link VCP

suhfi
Senior

Hello, i am using STM32F411RE with raspberry pi 4. i want to communicate rasp with stm32 through usb cable from pi to CN1 of stm32. i want the communication both ways. could you please tell me how to do it?
Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

@suhfi wrote:

okay, we enable the usart connectivity, how do we connect them


The UART connection is carried over the USB link.

  • Whatever is sent from the UART on the STM32 will be received on the host via its Virtual COM Port; eg, COM13 on your PC or /dev/ttyACM0 on my Raspberry Pi
  • Whatever is sent to the Virtual COM Port on the host (eg,COM13 or /dev/ttyACM0) will be received at the UART on the STM32.

@suhfi wrote:

but i can say the stm32 nucleo board and raspberry pi 4 has voltage differences 


That's all taken care of by the USB link

 


@suhfi wrote:

 i dont want jumper pins to be connected. 


The default configuration of the Nucleo board is that USART2 of the stm32f411re microcontroller chip is connected to the ST-Link's VCP - you shouldn't need to modify any links.

View solution in original post

26 REPLIES 26
Andrew Neil
Evangelist III

You need to give more details:

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

 


@suhfi wrote:

CN1 of stm32.


STM32 is just the microcontroller chip - it has no CN1

Are you talking about a Nucleo-F411RE board ?

 

AndrewNeil_1-1726652761299.png

https://www.st.com/en/evaluation-tools/nucleo-f411re.html

In which case CN1 is the ST-Link connector.

So you're wanting to use the ST-Link's VCP (Virtual COM Port) for UART communication with your RPi?

https://www.st.com/resource/en/user_manual/um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf#page=25

Does the ST-Link's VCP show up on the RPi when you plug it in?

 

SofLit
ST Employee

Hello @suhfi ,

The title needs to provide a summury of your request. Putting "Communication" as a title doesn't give a clear information about your request. The title needs also to be concise. I'm updating your title then ..

I invite you to read these tips on how to post in this community.

Thank you for your understanding.

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.
Andrew Neil
Evangelist III
suhfi
Senior

yes, i want to know how to do the communication between stm32f411re and raspberry pi 4 using usb cable connected to raspberry pi 4 and CN1 of stm32f411re. how can i do that.
i have seen many blogs but none of them are clear how to do thatt.

i want two way communication between them.

You need that Raspberry detects your STLINK as VCP (Virtual Comport).

So it's a Linux stuff not related to the STM32:

So to me the subject is more: "How to detect and use Serial Ports under Linux"

See these links:

https://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/

https://thelinuxforum.com/articles/752-how-to-list-serial-ports-on-linux

...

I think you need to get something like: ttyUSB

 

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 wrote:

 CN1 of stm32f411re. .


Again, stm32f411re is just the MCU chip - it has no CN1.

https://www.st.com/en/microcontrollers-microprocessors/stm32f411re.html 

These are chips:

AndrewNeil_0-1732092551027.png

 

So are you talking about a Nucleo-F411RE board ?

https://www.st.com/en/evaluation-tools/nucleo-f411re.html 

To clarify, the chip is highlighted in red; the board in blue:

AndrewNeil_0-1726659702966.png

AndrewNeil_1-1726660068002.png

https://community.st.com/t5/stm32-mcus-boards-and-hardware/nucleo-stm32f303k8-pa3-pin-doesn-t-work-for-uart-receive/m-p/690491/highlight/true#M19880

 

PS:

Another example:

https://community.st.com/t5/stm32-mcus-products/diffrence-between-stm32f29i-disc1-and-stm32f429zi/m-p/745107/highlight/true#M266845

 

#BoardVsChip #ChipVsBoard


@SofLit wrote:

You need that Raspberry detects your STLINK as VCP (Virtual Comport).


Exactly.

Do you know if an ST-Link's VCP should "just work" on Linux (and on RPi Linux, in particular)?

so i have enabled communication device class, and wrote the code for transmitting. but when i connect in Teraterm, i am not able to see the transmitted message. the stm32f411re isn't sending the message. i tried debugging the code and i can see the data that is sent is blank, that means stm32 isn't sending the data. 


@Andrew Neil wrote:

Do you know if an ST-Link's VCP should "just work" on Linux (and on RPi Linux, in particular)?


I think it could.. It's detected on windows as VCP I don't see any reason why it won't be detected on Linux.

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.