cancel
Showing results for 
Search instead for 
Did you mean: 

USBH_CtlSendData()

iozho
Associate II
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);

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

It seems the functionality was not tested properly...

iozho
Associate II
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
Associate II
Posted on June 21, 2011 at 19:02

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

novikov
Associate II
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.