cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
1,601 Views
Registered: ‎03-24-2018

usb gadget zero creation from user space

Hi

 

I would like to create a linux usb gadget, similar to gadget zero, using 'ConfigFS and libusbg library' from user space.

I have googled  and found out how to do it using 'scripts' from user space.

 

My question is:

how to create Gadget Zero using C++/C code from user space to create Gadget Zero?

 

OR

 

If I would like to use 'default kernel gadget zero driver', how to write an application? which /dev node to open?

 

Thanks in advance.

0 Kudos
2 Replies
Highlighted
Explorer
Explorer
1,544 Views
Registered: ‎07-05-2017

Re: usb gadget zero creation from user space

Hi Sungrace,

 

Were you able to figure out on how to write an application in Petalinux using gadget zero driver?

 

I'm using a zedboard with "avent-digilent-zedboard-v2017.3-final.bsp" to build Petalinux kernel.

 

In the Xilinx Petalinux Boot, is see a module g_zero.ko. I assume this the the gadget zero. it was under

# /lib/modules/4.9.0-xilinx-v2017.3/kernel/drivers/usb/gadget/legacy/g_zero.ko

 

I have also tried the Zynq USB Device Driver link shown below, with not much success: "http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver#Peripheral%20Mode-Kernel%20Configuration

 

I tried to modify a Petalinux created module  to a "Linux Kernel Module - USB Device Driver 02" tutorial off of youtube. Even though module structure looks similar to Petalinux created Platform_driver structure, I got a whole bunch of compile errors. 

 

I could not find any good Xilinx tutorial yet that describe how to use the the Petalinux USB supplied drivers nor how to make a USB driver that runs under Petalinux. Maybe we can put two heads together to figure this out.

Thanks!

Aynilian

 

0 Kudos
Highlighted
Visitor
Visitor
1,404 Views
Registered: ‎03-24-2018

Re: usb gadget zero creation from user space

I am sorry, I have not been to the forum recently.

I am not using Petalinux, but Git repo of linux-xilinx.

I use Buildroot to build the code.

 

Having said that:

 

I have modified and using gadget_zero driver's loopback implementation (not source/sink).

This Custom implementation doesn't do loopback anymore, but my requirement is to send data from our board to Host.

I am able to receive Host application Vendor specific commands through USB and send data to host.

 

Regards

0 Kudos