Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 07-02-2019, 07:37 AM   #1
LQ Newbie
Registered: Jul 2019
Posts: 1

Rep: Reputation: Disabled
USB ConfigFS + FunctionFS: read() of endpoint bundles packets


I want to use a iMX7-SOM as a vendor specific device (gadget) on a Windows10-PC with WINUSB driver. I'm using a Angstrom-based, Yocto-made image with Kernel v4.9.166.

I configured the gadget with libusbgx, mounted the functionfs at /ffs and wrote the descriptors to /ffs/ep0. The device is enumerated as expected and I get the commands on endpoint 0 (like "BIND", "ENABLE", "DISABLE" etc.).

So far so good...

My problem is the reading from endpoint 1.
I open it with
int ep_fd = open("/ffs/ep1", O_RDONLY);
and read from it with
unsigned char buffer[65535];

int ret = read(ep_fd, buffer, sizeof(buffer));
The read() returns every 4 received USB-packets. It doesn't matter wether I send 4 data packet or 1 data and 3 zero-packets. The size of the packets is also irrelevant.

At least none of the data is lost

Another SOM with a Snapdragon 410 from Qualcomm has the same behavior.

Does anybody know how I can/must configure the endpoint that the read() returns after every single received packet?

Best regards,

Last edited by Mowlwurf; 07-02-2019 at 09:41 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Configfs Composite Gadget - uvc and g_webcam e.u.mikhailov Linux - Newbie 3 07-06-2018 04:52 AM
set feature halt endpoint fails always USB linux driver usb gadget serial dot c sarmads1 Linux - Kernel 0 08-14-2012 11:06 PM
ocfs2 Unable to load module "configfs" pjohnson Linux - Newbie 1 06-19-2008 05:37 PM
Endpoint security - USB file filter kh_ibrahim Linux - Hardware 2 05-03-2007 08:11 AM
[usb module] acces to an IN Endpoint impossible ??? allawos Programming 1 01-19-2005 03:27 AM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration