imx6ul:how to use the one usb dev with different Device endpoint

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6ul:how to use the one usb dev with different Device endpoint

905 Views
半醒的狐狸
Contributor I

hi

i use the usb g_serial module:

modprobe g_serial  use_acm=0

in the /dev. i can saw the ttyGS0。

connect pc ,i can saw the Device endpoint use the libusb:

usb信息.bmp

i can use :

int usb_fd = open("/dev/ttyGS0", O_RDWR);

and use the usb by read and writ functoin.

in the pc ,i use the libusb-win32-bin-1.2.6.0 .

in a qt project, i read and write the usb by:

usb_bulk_write(dev, EP_OUT, tmp, sizeof(tmp), 5000);

usb_bulk_read(dev, EP_IN, tmp, sizeof(tmp), 5000);

1.how to use the timeout in arm board?

i use the select to implement this function.

is there have other way to implement this function?

2.i want to use the Device endpoint 00h.

there is only one ttyGS0.how can i identification the data from the pc with different endpoint address?

and hwo can i send and receive data by endpoint 00h?

in the /sys/bus/usb/devices/usb1:

00.bmp

int the /sys/bus/usb/devices/usb1/1-0:1.0:

81.bmp

if i can use these files to send and receive data by different endpoint? how?

thanks for you help!!

Labels (3)
0 Kudos
2 Replies

496 Views
igorpadykov
NXP Employee
NXP Employee

Hi

endpoint 0 is special Control endpoint and can not be used

for other purposes. Description can be found in usb2.0 specification

(on usb.org) and for example on

USB in a NutShell - Chapter 4 - Endpoint Types

USB in a NutShell - Chapter 5 - USB Descriptors

timeout example can found on patches

i.MX6 AVB Demo Implementation

simple usb example with different endpoints can be found

in attached sdk example, please pay attention to

Chapter 34 Configuring the USB Host Controller Driver

pdf document.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

496 Views
半醒的狐狸
Contributor I

hi

can i use two endpoint to transfer or receive data at the same time?

how?

thanks!

0 Kudos