usbd_open_pipe

Hi,

I am trying to writing code to open and interact with the USB stack.
When I call usbd_open_pipe, it works properly for the control
endpoint and the Bulk Out endpoint, but not for the Bulk In endpoint.


I know that the device I am using is a Bulk Input/Output device. Below
is a part of the output form usb -vvv.

Configurations : 1
Configuration : 1
Attributes : 0x80 (Bus-powered)
Max Power : 60 mA
Interfaces : 1
Interface : 0 / 0
Class : 0xff (Vendor-specific)
Subclass : 0xff
Protocol : 0xff
Endpoints : Control + 2
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Bulk/IN
Max Packet Size: 64
Endpoint : 2
Attributes : Bulk/OUT
Max Packet Size: 64

I am using the following code to access the endpoints.

endpt0 = usbd_endpoint_descriptor(device, 1, 0, 0, 0, &node);
if(endpt0 == 0)
printf(“control error \n”);

endpt1 = usbd_endpoint_descriptor(device, 1, 0, 0, 1, &node);
if(endpt1 == 0)
printf(“Bulk IN error \n”);

endpt2 = usbd_endpoint_descriptor(device, 1, 0, 0, 2, &node);
if(endpt2 == 0)
printf(“Bulk OUT error \n”);

I would be very grateful, if anybody could help me with this problem.
Thank you so much.

I missed adding some code to the above message. Here it is:

res0 = usbd_open_pipe(device, endpt0, &pipe_ctrl);
if(res0 != EOK)
printf(“Control error \n”);

res1 = usbd_open_pipe(device, endpt1, &pipe_in);
if(res1 != EOK)
printf(“Bulk IN error \n”);

res2 = usbd_open_pipe(device, endpt2, &pipe_out);
if(res2 != EOK)
printf(“Bulk OUT error \n”);

Thanks again.