I have this configuration of MCUs.
I need to know how connect the STlink on NUCLEO to discovery because I need the Virtual com PORT.
I have this configuration of MCUs.
I need to know how connect the STlink on NUCLEO to discovery because I need the Virtual com PORT.
I am assuming you want to connect two boards using USB cable and establish serial communication between them.
The Discovery board has USB Micro-AB port with OTG support (CN5). This can work as USB host. You need USB cable with Micro-A connector on this side. And of course you have to configure USB host in Cube middleware.
On the Nucleo board you have two choices.
First, the STLink Mini-B port (CN1) is connected to on-board STLink MCU, so you cannot use it directly. However STLink pins PA2, PA3 are by default connected via solder bridges to the target F401 USART port. This allows you to use USART without bothering with "virtual" stuff and STLink will create VCP and basically act as USB-to-UART dongle. You would need Mini-B connector on this side of the cable.
Alternatively, you can wire your own USB socket to pins PA11, PA12 and then configure USB device in middleware.
As for actual coding, there are tons of examples on the web, including this site. Here are some examples: configure CDC on F401RE, F401RE as a USB device
And here CDC device and host is almost exactly your setup, with nice detailed video.