Skip to main content
Associate III
September 18, 2024
Solved

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

  • September 18, 2024
  • 4 replies
  • 8563 views

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.

Best answer by Andrew Neil

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

4 replies

Andrew Neil
Super User
September 18, 2024

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?

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
ST Technical Moderator
September 18, 2024

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 "Best answer" on the reply which solved your issue or answered your question.
Andrew Neil
Super User
September 18, 2024
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
suhfiAuthor
Associate III
September 18, 2024

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.

mƎALLEm
ST Technical Moderator
September 18, 2024

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 "Best answer" on the reply which solved your issue or answered your question.
Andrew Neil
Super User
September 18, 2024

@suhfi wrote:

 i have understood what you have said


Clearly, you haven't.

The CN1 connector on the Nucleo-F411RE board connects only to the ST-Link - it does not connect to the stm32f411re microcontroller chip.

The ST-Link's VCP is connected to USART2 of the stm32f411re microcontroller chip:

AndrewNeil_0-1726663381730.png

Therefore, if you want to communicate via the ST-Link's VCP, you need to use USART2 of the stm32f411re microcontroller chip.

You do not use the USB within the stm32f411re microcontroller chip.

 

PS:

The current User Manual for the Nucleo board is unhelpful in that it doesn't clearly show the VCP connection:

AndrewNeil_0-1726664185039.png

This has been reported to ST, but not yet corrected:

https://community.st.com/t5/stm32-mcus-boards-and-hardware/nucleo-user-manuals-don-t-show-the-vcp-uart-connection/m-p/644959/highlight/true#M17438

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.