Skip to main content
Explorer
March 5, 2024
Question

Connecting to STM32 on NUCLEO-G474RE over USB

  • March 5, 2024
  • 4 replies
  • 3974 views

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!

 

    This topic has been closed for replies.

    4 replies

    Graduate
    March 5, 2024

    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.

    Super User
    March 5, 2024

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

     

     

    Explorer
    March 5, 2024

    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

     

    Graduate II
    March 5, 2024

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

    Technical Moderator
    March 5, 2024

    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.