Skip to main content
Visitor II
May 4, 2021
Solved

STM32F401 USB user descriptor strings

  • May 4, 2021
  • 4 replies
  • 2076 views

Hello,

is there any way to set the user descriptor string on the USB CDC device?

In the HAL library, I found some functions related to descriptor strings, but their type is "get" and I did not find a corresponding "set" functions.

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

    Descriptors are found within "usb_desc.c" when generated by CubeMX. Not sure what "user descriptor string" is referring to in particular though.

    4 replies

    Super User
    May 4, 2021

    USB string descriptors are not writable from host side. So, no set request.

    Super User
    May 4, 2021

    > USB string descriptors are not writable from host side. So, no set request.

    It may sound surprising, but yes, they are. See USB2.0, 9.4.8 Set Descriptor. String descriptors are one of the few which are allowed to set.

    This request is optional, though, and its implementation is probably extremely rare on both device and host side.

    JW

    PHude.1Author
    Visitor II
    May 4, 2021

    We don't understand here. I want to set the descriptor through the program in the STM device and read it with the program in Windows. We use a similar thing in our company with FTDI VCP ICs and I have to replace the external USB VCP IC with the internal USB VCP in the STM.

    TDKAnswer
    Super User
    May 4, 2021

    Descriptors are found within "usb_desc.c" when generated by CubeMX. Not sure what "user descriptor string" is referring to in particular though.

    PHude.1Author
    Visitor II
    May 4, 2021

    Thank you, USBD_PRODUCT_STRING_FS is visible in the Device manager as some parameter (I don't know their english name). This can be usable. Now i must find how it read in the windows app.