cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 USB Host - does it require additional pins?

GPerk.1
Associate III

I a wondering if it is possible to setup the host without VBUS and ID pin assigned. I would like to use USB A type (like laptops have) socket - there is no ID pin available and I do not VBUS detection as it is always ON.

1 ACCEPTED SOLUTION

Accepted Solutions

Is it possible to set up USB HOST without VBUS and ID pins? Yes.

Is it possible to set up the Cube's USB HOST stack without those pins? I don't know, I don't use Cube. Maybe not by clicking in CubeMX, but it's certainly possible to find the places in that stack where these pins are used and modify them as needed - Cube is open source.

I would be surprised if Cube would do anything with ID beyond initializing the pin. Last time I checked (and I admit it was a couple of years ago) there was no OTG support in Cube, and HAL_HCD_Init() directly set OTG_GUSBCFG.FHMOD without further ado.

The OTG's dedicated VBUS pin is not needed for HOST at all, it's again an OTG feature.

UM1720 mentions a switch (notoriously called "charge pump") for the VBUS supply, that's a GPIO which may be switched on upon some action; again, I am not interested enough to dig deep.

JW

View solution in original post

2 REPLIES 2

Is it possible to set up USB HOST without VBUS and ID pins? Yes.

Is it possible to set up the Cube's USB HOST stack without those pins? I don't know, I don't use Cube. Maybe not by clicking in CubeMX, but it's certainly possible to find the places in that stack where these pins are used and modify them as needed - Cube is open source.

I would be surprised if Cube would do anything with ID beyond initializing the pin. Last time I checked (and I admit it was a couple of years ago) there was no OTG support in Cube, and HAL_HCD_Init() directly set OTG_GUSBCFG.FHMOD without further ado.

The OTG's dedicated VBUS pin is not needed for HOST at all, it's again an OTG feature.

UM1720 mentions a switch (notoriously called "charge pump") for the VBUS supply, that's a GPIO which may be switched on upon some action; again, I am not interested enough to dig deep.

JW

GPerk.1
Associate III

Thanks @Community member​ , I confirm it is possible to configure USB host on L476 & L496 without any additional pins required (ID & VBUSx2).

I tested it on Nucleo-L476RG and L496-Disco with very little extra added(just in USB_host.c) to automatically generated code. Instruction how-to: http://evenlund.blogspot.com/