cancel
Showing results for 
Search instead for 
Did you mean: 

USB device whitout VBUS

mBosc.11
Associate II

Hello,

 I have a problem with USB device and VBUS, I have tried on several posts but I have not found the solution.

I try to explain, I use STM32H743, USB_OTG_HS, USB_DEVICE, COMUNICATION DEVICE CLASS and the problem is precisely VBUS which enters on pin PA9.

If I enable it on the VBUS pin and I got 5V, everything works, the device is enumerated and recognized and everything is beautiful.

BUT in this project the PA9 pin is used for other things, I read that it can also be done without it, even Cube allows you not to put it, and they tell you that you have to manage it manually. How ??? I have not found anyone who explains to me how to do to recognize the device through a generic IO pin. Who can help me. thank you

3 REPLIES 3
TDK
Guru

If it's a USB device and is always powered though USB, you can ignore the VBUS pin. You're supposed to disable the USB interface when VBUS isn't present to comply with USB specifications (you can't energize the data lines unless VBUS is present), but the STM32 doesn't care if you do or not.

To control it manually, configure it as a GPIO pin and either poll the input manually or use EXTI to detect when it falls. In which case, you need to disable USB.

If you feel a post has answered your question, please click "Accept as Solution".
mBosc.11
Associate II

I don't think I understand. The problem is that it is not recognized and therefore the computer does not enumerate the virtual com. Could you give an example of what needs to be done when I detect the most ..

Paul1
Lead

We use one USB for Diagnostics over VCP (UART to PC COM port), and it doesn't have VBUS connected (Actually on some boards just has the D+/D-/Gnd, and if USBC then the resistors to set mode.

This works on STM32L743, but attached zip is actually an STM32L476 example. It may have enough to get you over your speedbump.

We haven't tried assigning the STM's VBUS pin to other functionality. If that is blocking you then you may have to dig through the USB code to find where the pin is being checked, and modify the standard code (Ensure you log/highlight that change if needed so not lost in future).

Could also be the USB settings passed to the PC

  • i.e. UART settings not being echo'd back to PC correctly (Try using TeraTerm till you fix that, TeraTerm ignores them)

Paul