cancel
Showing results for 
Search instead for 
Did you mean: 

Set up a USB device using USB device library, how to set up Vendor-Specific Class?

usbdes777
Associate II

Hello,

I use EP1 (IN/OUT) for bulk transfer(64 byte) and EP2 (IN) for interrupt transfer(64 byte).

I need to use the Vendor-Specific Class for this configuration. 

Using STM32CubeIDE 1.18.0 to create a usb device, which class shall I use to create this 

 USB configuration. 

usbdes777_0-1747354783259.png

I tried using the Communication Device Class, because it includes EP1(IN/OUT) for bulk transfer and

an interrupt transfer endpoint.(primarily for sending notifications back to host)

Instead of using interrupt transfer endpoint for sending notifications,

I tried modifying this endpoint to send data back to the host when it polls for it.

However, the USB device does not seem to respond to the host polling.

Is this the correct way to do it?

I have also attached my source code

thank you very much!!

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @usbdes777 

You can start configure it as custom HID class.

If the host is a Windows computer, it is recommended to add a WinUSB device descriptor to the custom function to be able to use the WinUSB  API on the Windows side and avoid a custom driver.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


View solution in original post

3 REPLIES 3
Pavel A.
Super User

Please see here https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/automatic-installation-of-winusb how to create device descriptors for "vendor-specific" device that can be operated via the WinUSB or LibUSB libraries. Windows will automatically detect such devices, no extra drivers are needed.

The cube-generated code for any class can be adjusted manually. Add the proper interface descriptor and endpoint descriptors.

 

FBL
ST Employee

Hi @usbdes777 

You can start configure it as custom HID class.

If the host is a Windows computer, it is recommended to add a WinUSB device descriptor to the custom function to be able to use the WinUSB  API on the Windows side and avoid a custom driver.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


usbdes777
Associate II

Thanks for your advice,Much appreciated!