2024-03-05 08:41 AM
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!
2024-03-05 08:51 AM
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.
2024-03-05 08:55 AM - edited 2024-03-05 08:57 AM
@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:
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.
2024-03-05 10:36 AM
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
2024-03-05 12:46 PM
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.
2024-03-05 01:29 PM
If you've started a new "board" project then the VCP is already enabled. If you want interrupt, you have to enable the NVIC.
2024-03-06 04:26 AM
@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?
On enabling/disabling ST-Link options: