Skip to main content
Julian Winpenny
Associate III
Aug 2, 2018 1:31 PM UTC
Question

How to make STM32l475 work in USB host mode

STM32l475 USB host USBH_UserProcess() not progressing to HOST_USER_CLASS_ACTIVE

    This topic has been closed for replies.

    13 replies

    Tesla DeLorean
    Guru
    Aug 2, 2018 2:50 PM UTC

    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
    Aug 2, 2018 2:56 PM UTC

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

    Pavel A.
    Aug 2, 2018 3:30 PM UTC

    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
    Aug 2, 2018 3:33 PM UTC

    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
    Aug 2, 2018 4:35 PM UTC

    Pavel,

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

    Pavel A.
    Aug 2, 2018 11:11 PM UTC

    > 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
    Aug 3, 2018 6:54 AM UTC

    Hi,

    If you use USBH_Process() as Host Background task?

    Julian Winpenny
    Associate III
    Aug 3, 2018 8:11 AM UTC

    Chensie,

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

    Julian Winpenny
    Associate III
    Aug 3, 2018 8:27 AM UTC

    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
    Aug 3, 2018 8:50 AM UTC

    These are now in USBH_Conf.c

    USBH_LL_Init(phost);

    USBH_LL_Start(phost);

    Still no enumeration