2016-12-18 12:16 PM
Today I played with CubeMX and USB CDC device and I found very silly bug in generated code.
I chose USB FS Device only mode and I used CDC class. Nothing else set. I did not enable VBUS.
Generated code enabled VBUS sensing but VBUS sense pin was not enabled.
I spent 2 hours to figure that out.
Please correct this mistake, disable VBUS sense by default or if you enable VBUS sense, then also initialize VBUS pin to sense voltage.
Have a nice day.
#stm32f7 #stm32cubemx #usb2016-12-21 01:39 AM
Dear
Majerle.Tilen
,Which CubeMx version are you using ?
Best Regards
Imen
2016-12-21 03:11 AM
Latest, 4.18.
2016-12-21 05:47 AM
Hello
Majerle.Tilen
,I have checked and reproduced this casefrom my side.
I will share internally your feedback for further review and we will keep you informed about the taken actions/explanation if needed.
Thank you for your contribution.Best Regards
Imen
2017-01-03 08:08 AM
hello majerle,
FYI : there are two types of vbus available:
1- External Vbus (External Pin)2- Internal Vbus By default the internal VBUS is enabled -> this is your caseTo disable it, go to tab Configuration in CubeMX and open the USB configuration window, now you have to select disable for Vbus sensing parameter.
best regards,
Frantz
2017-04-20 01:25 PM
I have run into this also, thanks god for your post!
I run STM32CubeMX version 4.20.1 and don't have a setting in the USB on Configuration tab.
I had to edit the code by hand to fix, in USBD_LL_Init():
hpcd_USB_OTG_FS.Init.vbus_sensing_enable = DISABLE;