Skip to main content
Visitor II
March 30, 2021
Solved

STM32L4 USB Host - does it require additional pins?

  • March 30, 2021
  • 2 replies
  • 1100 views

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.

    This topic has been closed for replies.
    Best answer by waclawek.jan

    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

    2 replies

    Super User
    March 30, 2021

    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.1Author
    Visitor II
    April 2, 2021

    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/