cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with VCP USB FS and CubeMX STM32H7eval

Simon1
Associate

Hello, everybody.

I'm trying to implement USB FS on STM32H734 eval board. I'm using CubeMX to generate code, the version is up to date and i'm using the latest firmware libraries (which is 1.3.0). I generated a standard project and configured a VCP on USB FS in Cube, when i load the code into mcu and connect CN18 to PC nothing happened. Then I found that there is a function HAL_PWREx_EnableUSBVoltageDetector(); that needed to be added to USB initialization. Which i did and PC sees the board but can't find a driver for it (code 28) and locate it under unknown devices. I found that when cube generates code in main it generates function with name MX_USB_OTG_HS_PCD_Init(); but in settings (in Cube) FS confuguration is chosen. (And vice versa, MX_USB_OTG_FS_PCD_Init(); if HS configuration is chosen as VCP). I think it's some sort of bug. Could it be the source of a problem? Maybe someone else also encountered such a problem?

3 REPLIES 3

Probably not a super large constituency of CubeMX and H743I-EVAL users here.

Would recommend you confirm base line functionality with the example code, with USE_USB_FS definition.

STM32Cube_FW_H7_V1.2.0\Projects\STM32H743I_EVAL\Applications\USB_Device\CDC_Standalone\readme.txt

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Simon1
Associate

I'm sorry for late reply. Thank you for advice. It was just me being 'not smart', tried to use it on win7 without vcp driver from ST (ST-link was reconized as vcp and i decided that i already got one). Apart from that, everything works correct, but still i had to add function HAL_PWREx_EnableUSBVoltageDetector(), because it didn't have any reaction at all without it (with vbus sensing turned on). And with aforementioned functions (MX_USB_OTG_HS_PCD_Init() / MX_USB_OTG_FS_PCD_Init()) everything is also ok, when i turned VCP on FS USB it's wasn't otg anymore (instead new function MX_USB_DEVICE_Init(); appears in main). I had configured both usb HS / FS as otg at first and then configured USB FS as vcp, so i got a function in main for USB HS OTG initialization MX_USB_OTG_HS_PCD_Init() and other function MX_USB_DEVICE_Init(); for vcp config (and vice versa if configured HS as vcp, then FS was OTG, and of course i mixed it all up and misunderstood). I don't know if explained it all clearly, just tried to say that there are no problems if everything configured as needed.

It also worked for me on win10 with standard windows drivers. (Actually in description on vcp drivers download page it is said that it is even better to use standard driver for vcp, because their drivers have some problems in win 10). But i saw some posts in the internet where people installing ST drivers for win10, why? And is there any way to use STM32 vcp with standard vcp driver on windows 7? As far as i understand there is usbser.sys for that purpose on win7, but you still need to write your own inf file to load it. Need to do more research on that topic.

P.S. Thread isn't very useful or informative, maybe it is better to delete it? Or leave it and mark as answered?

Amel NASRI
ST Employee

Hi @Simon​ ,

I suggest to keep this thread, and close it.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.