AnsweredAssumed Answered

STM32 F4 USB FS Host: CDC device plugged before device start

Question asked by h p on Jul 27, 2017
Latest reply on Jul 27, 2017 by h p



we are using the USB Full Speed host port on an STM32F4 with FreeRTOS.


We use the most recent libraries:

- stm32f4xx_hal_hcd.c stm32f4xx_hal_hcd.c and stm32f4xx_ll_usb.c version 1.7.0

- CubdF4 niddleware STM32_USB_Host_Library V3.2.2 / 07-July-2015


The USBH_USE_OS is defined to 1. 


The USB Host middleware is initialized about 5 seconds after device start.

The USBH_CDC_CLASS and the USBH_MSC_CLASS are registered.


Everything is working faultlessly up to the following use case:


In case the CDC device is already plugged BEFORE the device is started then no URB SETUP response is received from the CDC device. After unplugging the CDC device and pliugging the CDC device  again the communication works normally.


We also tried to initialize the USB middleware very early but the USBH_Process thread was still running after 5 seconds because the scheduler is started then. In this case the above use case (CDC device connected before startup) was working. But if we unplug the CDC device before the start of the USBH_Process thread and plug the CDC device again it is not enumerated anymore.


What must be changed in order to get this working?

Thanks for any help in advance.