2020-01-19 11:18 AM
Hi, All!
I am writing a driver to support a custom usb device (like CDC Class). I use example stm324xG-EVAL_USBH-HS (yes, HS). I have a recording made using a wireshark (linux - device):
1) make the first request
2) get a confirmation
3) asking for an answer
4) can’t wait for an answer
My code:
one and two step:
// send request
uint32_t msg[6] = {init_val};
..
phost->Control.setup.b.bmRequestType = USB_H2D | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE;
phost->Control.setup.b.bRequest = 0U;
phost->Control.setup.b.wValue.w = 0U;
phost->Control.setup.b.wIndex.w = 0U;
phost->Control.setup.b.wLength.w = 24;
res = USBH_CtlReq(phost, (uint8_t *)&msg,24);
three and four step:
phost->Control.setup.b.bmRequestType = USB_D2H | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE;
phost->Control.setup.b.bRequest = 1U;
phost->Control.setup.b.wValue.w = 0U;
phost->Control.setup.b.wIndex.w = 0U;
phost->Control.setup.b.wLength.w = 1025;
res2 = USBH_CtlReq(phost, (uint8_t *)&response_buf, 1025);
Always res2 = USB_BUSY!
What could be the problem?
Maybe I'm doing the wrong request?
Best Regards, Aleksandr.