cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 USB user descriptor strings

PHude.1
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5
Pavel A.
Evangelist III

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

PHude.1
Associate III

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.

TDK
Guru

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

If you feel a post has answered your question, please click "Accept as Solution".
PHude.1
Associate III

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.

> 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