Jump to content

Gadgetfs


Aodren

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

Quote

ep_descriptor_out.bEndpointAddress = USB_DIR_OUT | 2;

 

to

Quote

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 https://github.com/torvalds/linux/tree/master/drivers/usb/gadget , 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.

 

Thanks

 

 

 

Link to comment
Share on other sites

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 :

Quote

#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 comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines