Skip to main content
Julian Winpenny
Associate III
August 2, 2018
Question

How to make STM32l475 work in USB host mode

  • August 2, 2018
  • 13 replies
  • 3023 views

STM32l475 USB host USBH_UserProcess() not progressing to HOST_USER_CLASS_ACTIVE

    This topic has been closed for replies.

    13 replies

    Tesla DeLorean
    Guru
    August 2, 2018

    Not really my thing, have you tried the examples, do they work?

    STM32Cube_FW_L4_V1.12.0\Projects\B-L475E-IOT01A\Applications\USB_Host\MSC\readme.txt

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Julian Winpenny
    Associate III
    August 2, 2018

    I've not tried that. Where do I download the examples from?

    Pavel A.
    August 2, 2018

    Try this:

    1. In your CubeMx settings, enable maximum debug level for USB
    2. Make printf work somehow - print to UART or ITM trace and so on.
    3. Run the program, then plug in some USB device.

    There should be debug messages from USB host stack when the devices are enumerated, even if there's no any class module that supports them. So you will see whether the USB core works.

    -- pa

    Tesla DeLorean
    Guru
    August 2, 2018

    If you're using CubeMX they'll be under your repository directory (see Help -> Updater Settings)

    Or pull the file/archive manually

    https://www.st.com/en/embedded-software/stm32cubel4.html

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Julian Winpenny
    Associate III
    August 2, 2018

    Pavel,

    I tried the extra debug, but I still only see "USB Device Attached"

    Pavel A.
    August 2, 2018

    > but I still only see "USB Device Attached"

    This means that enumeration does not start properly. Maybe you do not provide enough voltage to the device.

    -- pa

    Chensie
    Visitor II
    August 3, 2018

    Hi,

    If you use USBH_Process() as Host Background task?

    Julian Winpenny
    Associate III
    August 3, 2018

    Chensie,

    As I'm using FreeRtos USBH_Init() already creates a thread for USBH-Process()

    Julian Winpenny
    Associate III
    August 3, 2018

    I think the problem is the USB low level driver was not included by STM32CubeMx

    These (and others) are missing functions:

    USBH_LL_Init(phost);

    USBH_LL_Start(phost);

    Julian Winpenny
    Associate III
    August 3, 2018

    These are now in USBH_Conf.c

    USBH_LL_Init(phost);

    USBH_LL_Start(phost);

    Still no enumeration