cancel
Showing results for 
Search instead for 
Did you mean: 

How to make STM32l475 work in USB host mode

Julian Winpenny
Associate II

STM32l475 USB host USBH_UserProcess() not progressing to HOST_USER_CLASS_ACTIVE

13 REPLIES 13

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 Up vote any posts that you find helpful, it shows what's working..
Julian Winpenny
Associate II

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

Pavel A.
Evangelist III

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

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 Up vote any posts that you find helpful, it shows what's working..
Julian Winpenny
Associate II

Pavel,

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

Pavel A.
Evangelist III

> 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
Associate II

Hi,

If you use USBH_Process() as Host Background task?

Julian Winpenny
Associate II

Chensie,

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

Julian Winpenny
Associate II

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);