cancel
Showing results for 
Search instead for 
Did you mean: 

Structure of STM32_USB_HOST_Library

RhSilicon
Lead

Hi,

I'm looking to understand the core of the USB Host library, so I thought of trying to update an old project (See: BTstack Port for STM32 USB for details), from the time when there was no STM32CubeIDE (as demonstrated here).

The project was created with CubeMX, used the Eclipse IDE, and compiled using Makefile. So it shouldn't be too difficult to update, the issue is that the project is of the Wireless Controller class (Base address 0xE0).

I found an old post (year 2014), where this Class is operated within the CDC communication, which seemed strange to me.

''Does the Android phone tether over USB?

Android tethering is based on RNDIS protocol (subclass of CDC, by MS)''Yes it does: 

pphost->device_prop.Itf_Desc[0] has 0xE0, 0x01, 0x03

(Class: 0xE0; SubClass: 0x01; Protocol: 0x03)

But the USB-IF defines the class 0xE0 as Wireless Controller,

In the SubClass 0x01 it has the Protocols

  • Bluetooth Programming Interface for value 0x01
  • UWB Radio Control Interface for 0x02
  • Remote NDIS for value 0x03

The STM32_USB_HOST_Library has these folders for All Supported Classes:

  • AUDIO, CDC, HID, MSC, and MTP

In this way, the name of the class 0xE0 should be abbreviated in what way?

Whereas "Mass Storage Device Class" became "MSC", then "Wireless Controller" became "WCC"?

So the main file comes to be usbh_wcc.h in Inc folder ("WCC/Inc") and usbh_wcc.c in Src folder ("WCC/Src").

There are a lot of auxiliary files, *.h and *c, can they be in a folder inside the Src folder or in a new folder inside the "WCC" folder? Perhaps an "Aux" folder ("WCC/Aux" path)?

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

Hi,

The "classes" in the ST USB host library are not set in stone, they rather are examples or prototypes that you are free to modify for your needs. The "core" driver detects the device class by the class code, but you can modify this as well.

On the structure: the lowest level is the host controller driver located in Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c.

The "core" is the next level.  On top of it sits the "class" layer, which you already know.

The CubeMX/IDE generates a thin wrapper around al that, and initialization code.

Good luck.

 

View solution in original post

1 REPLY 1
Pavel A.
Evangelist III

Hi,

The "classes" in the ST USB host library are not set in stone, they rather are examples or prototypes that you are free to modify for your needs. The "core" driver detects the device class by the class code, but you can modify this as well.

On the structure: the lowest level is the host controller driver located in Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c.

The "core" is the next level.  On top of it sits the "class" layer, which you already know.

The CubeMX/IDE generates a thin wrapper around al that, and initialization code.

Good luck.