Review your favorite Linux distribution.
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 11-17-2019, 11:35 PM   #1
LQ Newbie
Registered: Nov 2019
Posts: 2

Rep: Reputation: Disabled
Activating alternate setting leads to a STALL with FunctionFS

I'm trying to create a Gadget using FunctionFS and the FS driver on a IMX8 board running a Debian (kernel 4.14.98). My gadget is composed of two functions with the following configurations:
Function 1:
Interface 0:
Endpoint BULK OUT 0x01 Endpoint BULK IN 0x81
Function 2:
Interface 0 Alternate setting 0:
No Endpoint
Interface 0 Alternate setting 1:
Endpoint BULK OUT 0x02 Endpoint BULK IN 0x82
Everything works fine until I activate the alternate setting 1 in Function 2 using libusb's libusb_set_interface_alt_setting from another computer. libusb shows no error but the exchanged USB packets show that a STALL has been returned from the board. There is also no debug information in the kernel logs concerning the STALL. This problem is not due to libusb as I have the same issue (and STALL) if I connect the gadget to another board not relying on libusb to communicate.

I tried changing the USB descriptors (endpoint addresses, alternate setting in function 1) and the code (when I open the endpoints, using one function instead of two) but nothing changes the outcome. I also looked in the kernel source code to figure where the error is but have found no obvious places that could create a STALL.

Anybody else having faced a similar issue or having any idea on how I could figure out what's happening? I would really appreciate the help.
Old 11-25-2019, 08:39 PM   #2
LQ Newbie
Registered: Nov 2019
Posts: 2

Original Poster
Rep: Reputation: Disabled
I found the solution if anybody has the same problem. The problem is that FunctionFS does not completely support alternate settings. It lacks one function for that. So the only solution is create a new function with that function and add it to the kernel.

I put more details there:


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
USB ConfigFS + FunctionFS: read() of endpoint bundles packets Mowlwurf Linux - Embedded & Single-board computer 0 07-03-2019 02:44 PM
Connection sharing - clients stall when browsing. cirofren Linux - Networking 6 10-31-2003 08:51 AM
Download stall question. rvijay Linux - Newbie 8 10-09-2003 08:21 AM
Downloads Stall BruceCadieux Linux - Networking 2 07-17-2002 11:49 PM
Mandrake 8.2 install stall! joannew Linux - Software 1 05-27-2002 01:29 PM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 08:24 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