cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting to STM32 on NUCLEO-G474RE over USB

c_shearer_cooper
Associate III

I'm just getting started with the STM32, only got the NUCLEO-G474RE board yesterday.

I need to communicate from a PC to the STM32 over USB.  Am I correct in assuming that the CN1 USB connector is only available for ST-LINK, and I need to attach a second USB connector with breakout pins onto the Morpho connector?

Is there a brief description somewhere of which USB lines go to which Morpho pins?

Thanks!

 

6 REPLIES 6
gbm
Lead III

Right, you need to add a board with a USB connector. See the manual for your Nucleo board and the STM32G474 datasheet for Nucleo pin connections and G474 pin functions respectively.

The latest Nucleo-64 boards (with H5 and U5 series), finally add the long-awaited USB connector.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Andrew Neil
Evangelist III

@c_shearer_cooper wrote:

I need to communicate from a PC to the STM32 over USB.


What kind of communication do you need?

The ST-Link on the board also provides a Virtual COM Port (VCP);  that allows you to communicate from a PC to the STM32's UART over USB - see Fig 3 in the User Manual:

AndrewNeil_0-1709657697630.png

See also section 6.6.5

 


@c_shearer_cooper wrote:

Is there a brief description somewhere of which USB lines go to which Morpho pins?


That's in the User Manual; see also the board schematics.

 

 

c_shearer_cooper
Associate III

Thanks for the pointers!  But I can't figure out how to tell the STLink to enable its VCP.  Is there a document that shows me how to configure the IOC file in STM32CubeIDE?

Chris

 

Imen.D
ST Employee

Hello @c_shearer_cooper and welcome to the Community :)

- Did you install the driver STSW-LINK009? Try installing/updating the ST-Link firmware version through this link STSW-LINK009.

- I suggest that you start your project from CubeMX where you configure your peripherals and generate the initialization code using STM32CubeIDE.

You can also refer to the available examples under the STM32CubeG4 package, which can help you to develop your application, then you can modify the application depending on your needs:

Take a look to this user Manual UM1718 for more detail about STM32CubeMX tool and how configure the IOC file.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

If you've started a new "board" project then the VCP is already enabled. If you want interrupt, you have to enable the NVIC.

Tips and Tricks with TimerCallback https://www.youtube.com/@eebykarl
If you find my solution useful, please click the Accept as Solution so others see the solution.

@c_shearer_cooper wrote:

I can't figure out how to tell the STLink to enable its VCP


You shouldn't need to enable it - it should be enabled by default

Does it appear in your Device Manager?

AndrewNeil_0-1709727880602.png

 

On enabling/disabling ST-Link options:

https://community.st.com/t5/stm32-mcus-products/question-can-i-disable-the-nucleo-onboard-stlink-mass-storage/m-p/464705