Recommended Posts

Hi everyone,

I want to create an USB device, for this i am following this tutorial : gadgetfs.


It works fine, but when i want to have an endpoint superior to 4, i cannot.

I just changed


ep_descriptor_out.bEndpointAddress = USB_DIR_OUT | 2;




ep_descriptor_out.bEndpointAddress = USB_DIR_OUT | 5;



Unfortunately, in the folder created i have only this files :

  • ep1in 
  • ep1out 
  • ep2in 
  • ep2out 
  • ep3in 
  • ep3out 
  • ep4in 
  • ep4out 
  • musb-hdrc

I thought a usb device can have 32 endpoints.


So, is it possible to have an extra endpoint ?




And i have an extra question, as a kernel noob, I don't fully understand how this guy came out with this tutorial. i want to understand more for myself what it's going on.

I understand the C code,  but i don't understand how this guy find out the way to talk with the module gadgetfs.

If am not mistaken in linux, you can use API to talk with drivers. Those API, in user space are just file where we can read/write and for kernel space they call it gadget ?

When i look in , i don't where to look at.


Do you have some good external link, that i can read to improve my comprehension, and if someone can summarize, it would be nice.






Link to post
Share on other sites
Donate and support the project!

OK, so i read some headers and a few documentations but what i understand, it's that gadgetfs bind musb drivers, and when i check into linux/drivers/usb/musb/sunxi.c i found a define :


#define SUNXI_MUSB_MAX_EP_NUM_H3    5 


so it will create only ep 0 to ep 4.

And i al currently working with a H3 (orange pi zero)

I will try with a Orange pi Zero + because it should have 6 endpoints.


Edit: same result with Orange pi zero + still not have endpoint 5


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.