想用stm32F407做usb-host去读取hid温度计设备,参考的是st的msc优盘例程,能枚举优盘和鼠标,但枚举hid自定义设备失败,有没有朋友能提供些帮助?
USBH_Status USBH_HandleControl (USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost)
{
....
case CTRL_SETUP: USART_SendString(USART1,"\r\n CTRL_SETUP \r\n");
/* 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: USART_SendString(USART1,"\r\n CTRL_SETUP_WAIT \r\n");
URB_Status = HCD_GetURB_State(pdev , phost->Control.hc_num_out);
/* case SETUP packet sent successfully */
if(URB_Status == URB_DONE)
{
}
.....
}
现在一直在 CTRL_SETUP_WAIT这个状态循环, URB_Status 一直到不了URB_DONE。求帮助 求指点 谢谢! |