Skip to main content
iozho
Associate II
June 19, 2011
Question

USBH_CtlSendData()

  • June 19, 2011
  • 4 replies
  • 1379 views
Posted on June 19, 2011 at 18:57

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);

    This topic has been closed for replies.

    4 replies

    iozho
    iozhoAuthor
    Associate II
    June 20, 2011
    Posted on June 20, 2011 at 18:46

    It seems the functionality was not tested properly...

    iozho
    iozhoAuthor
    Associate II
    June 21, 2011
    Posted on June 21, 2011 at 16:57

    Here is more info - if I turn the optimization on the I pass the point where data the data is send so I complete the whole transfer. But when I try to initiate the same transfer again I fail. Is there a way to control the time value (I could not see a way)?

    iozho
    iozhoAuthor
    Associate II
    June 21, 2011
    Posted on June 21, 2011 at 19:02

    Apperantly nobody ever tested this with GCC... Very unprofessional.

    novikov
    Associate
    October 20, 2015
    Posted on October 20, 2015 at 10:32

    Hello!!!

    I

    have

    the same problem.I'm trying to send a command CDC_SEND_ENCAPSULATED_COMMAND with payload 24 bytes REMOTE_NDIS_INITIALIZE_MSG.

    But

    more

    than

    8 bytes

    are not transmitted.