2014-01-29 11:30 AM
I am writing the cdc host code on the discover board. The program can detect the device is connected but it cannot get the device description and go to the CDC_InterfaceInit function . Any one has the idea what's wrong?
Thanks2014-01-30 10:23 AM
I found in the below code, when call
URB_Status = HCD_GetURB_State(pdev , phost->Control.hc_num_out);
it always return 0. so the program never goes to ''if(URB_Status == URB_DONE)'' Any one know why? Thanks''USBH_Status USBH_HandleControl (USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost)
{ uint8_t direction; static uint16_t timeout = 0; USBH_Status status = USBH_OK; URB_STATE URB_Status = URB_IDLE; phost->Control.status = CTRL_START;switch (phost->Control.state) { case CTRL_SETUP: /* send a SETUP packet */ USBH_CtlSendSetup (pdev, phost->Control.setup.d8 , phost->Control.hc_num_out); phost->Control.state = CTRL_SETUP_WAIT; break; case CTRL_SETUP_WAIT:
URB_Status = HCD_GetURB_State(pdev , phost->Control.hc_num_out);
/* case SETUP packet sent successfully */ if(URB_Status == URB_DONE) { direction = (phost->Control.setup.b.bmRequestType & USB_REQ_DIR_MASK);