cancel
Showing results for 
Search instead for 
Did you mean: 

USB Get String Descriptor stall

MikeAtETI
Associate III
Posted on May 13, 2016 at 14:39

Hi,

I'm using the STM32CubeMX USB Device Library version 2.2.0 (generated by STM32CubeMX) and am occasionally getting the situation where getting the string descriptor stalls when requesting it for descriptor index 2 and 3, but other insertions it works no problem. It looks like a timing-thing, or I'm not properly resetting the peripheral. However, during the disconnect I added the following to the HAL_PCD_MspDeInit routine to try and get round this:

/* USER CODE BEGIN USB_MspDeInit 1 */
RCC->APB1RSTR |=RCC_APB1RSTR_USBRST;
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
RCC->APB1RSTR &=~RCC_APB1RSTR_USBRST;
/* USER CODE END USB_MspDeInit 1 */

Has anyone come across this before? #stringdescriptor #stm32 #usb #!cubemx
1 REPLY 1
Amel NASRI
ST Employee
Posted on May 23, 2016 at 17:02

Hi hudgell.michael,

In order to more understand the issue you are facing, we need more details on the case:

1- what device do you use?

2- which CubeMX version (last one is 4.15.0)?

3- how USB will be configured?

4- did you added your own code or you are facing issue with CubeMX generated code as is?

5- did you tried one of the USB examples already available in the STM32Cube packages? If there is no issue faced with these examples, you may check differences between CubeMX generated code and example.

-Mayla- 

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.