Skip to main content
Visitor II
May 16, 2025
Solved

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

  • May 16, 2025
  • 3 replies
  • 511 views

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!!

    This topic has been closed for replies.
    Best answer by FBL

    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.

    3 replies

    Super User
    May 16, 2025

    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.

     

    FBLAnswer
    Technical Moderator
    May 21, 2025

    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.

    usbdes777Author
    Visitor II
    May 22, 2025

    Thanks for your advice,Much appreciated!