AnsweredAssumed Answered

USBH_CtlSendData()

Question asked by petrov.konstantin on Jun 19, 2011
Latest reply on Oct 20, 2015 by novikov.valerii
Hi:

I have problem with this function - it just doesn't work if you want to send some data (> 0 bytes). The setup packet is sent and ACK is received but when data packet is sent no response. See example below:

        uint8_t buf[1] = { val };
     setup.b.bmRequestType = 0x40;
     setup.b.bRequest = 0x04;
     setup.b.wValue = reg;
     setup.b.wIndex = 0;
     setup.b.wLength = 1;

     while (USBH_CtlSendSetup (&USB_OTG_FS_dev, 
                    &setup.d8[0], 
                    USBH_Machine.Control.hc_num_out) != USBH_OK);
     while (HCD_GetURB_State (&USB_OTG_FS_dev) != URB_DONE);
     
     while (USBH_CtlSendData (&USB_OTG_FS_dev, 
                    buf, 
                    sizeof(buf)/sizeof(buf[0]), 
                    USBH_Machine.Control.hc_num_out) != USBH_OK);

Outcomes