cancel
Showing results for 
Search instead for 
Did you mean: 

USB HOST custom device support (RNDIS). How to make a request?

Aleksandr S.
Associate II

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

0690X00000BwBSQQA3.png

2) get a confirmation

0690X00000BwBSaQAN.png

3) asking for an answer

0690X00000BwBSVQA3.png

4) can’t wait for an answer

0690X00000BwBSLQA3.png

   

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.

0 REPLIES 0