AnsweredAssumed Answered

USB Library 2.1.0 USBH_USR_DeviceDisconnected Problem ?

Question asked by futureelectronics on Mar 20, 2013
Latest reply on Mar 20, 2013 by futureelectronics
Hi. 
I use stm32f105 and STM32_F105-07_F2xx_USB-Host-Device_Lib_V2.0.0 usb library and i can handle  USBH_USR_DeviceDisconnected event when USBH_Process detects any Flash Disk when application starts.

But when i try to use STM32_USB-Host-Device_Lib_V2.1.0 usb library, USBH_Process function does not detect any Flash Disk. Only, after plugging in Flash disk, and after removing this event can be detected. 

When i looked the code, there are differences as follows...in v2.0.0, USBH_Process handles DISCONNECTED EVENT first time, but v2.1.0 does not detect this. 

v2.1.0
  if ((HCD_IsDeviceConnected(pdev) == 0)&& (phost->gState != HOST_IDLE)) 
  {
    if(phost->gState != HOST_DEV_DISCONNECTED) 
    {
      phost->gState = HOST_DEV_DISCONNECTED;
    }
  }

v2.0.0
  /* check device disconnection event */
   if (!(HCD_IsDeviceConnected(pdev)) && 
       (pdev->host.port_cb->DisconnHandled == 0))
  { 
    /* Manage User disconnect operations*/
    phost->usr_cb->DeviceDisconnected();
    
    pdev->host.port_cb->DisconnHandled = 1; /* Handle to avoid the Re-entry*/
    
    /* Re-Initilaize Host for new Enumeration */
    USBH_DeInit(pdev, phost);
    phost->usr_cb->DeInit();
    phost->class_cb->DeInit(pdev, &phost->device_prop);
  }  


First of all, i need to detect any disconnect event, when application starts first time. i want to use v2.0.0 USB library but i am not sure. i hope this is not bug. i read release notes of these libraries but i am not sure which one is much more suitable for usb application?...
Thanks in advance.
Best regards

Outcomes