Problem to use the USB OTG as gadget (peripheral) in linux.
I'm using the helio board from macnica with a SoC Cyclone V and I'm trying use the USB OTG of the board as device (gadget) in the linux. My target is connect the board to my PC and I want that my PC recognize the board as HID device or CDC device. With a little search in the web I discovered that I need enable the module libcomposite.ko and the module g_serial.ko. The kernel image that I use is from the site: http://rocketboards.org/foswiki/documentation/alterasocltsikernel. I have tryed with the kernel 3.13 and 3.18. When I use the kernel 3.13, I get the error: root@socfpga:~/drivers# insmod libcomposite.ko // OK no error root@socfpga:~/drivers# insmod g_serial.ko Error: could not insert module g_serial.ko: No such device in the dmesg have the message: couldn't find an available UDC I suppose that the error is because don't have the UDC (USB device controller) driver, I try enable the flag Designware/S3C HS/OtG USB Device controller in the → Device Drivers → USB support → USB Gadget Support → USB Peripheral Controller to enable the driver. but when I try it the kernel compilation brike with the error: make: *** No rule to make target `drivers/usb/gadget/s3c-hsotg.o', needed by `drivers/usb/gadget/built-in.o'. Stop. The most interesting is that in the drivers/usb/dwc2/Makefile have the follow message: # NOTE: This driver at present only implements the Host mode # of the controller. The existing s3c-hsotg driver supports # Peripheral mode, but only for the Samsung S3C platforms. # There are plans to merge the s3c-hsotg driver with this # driver in the near future to create a dual-role driver. Once # that is done, Host mode will become an optional feature that # is selected with a config option. In the kernel 3.18 this structure of the kernel was changed, but I have the same error when try execute the module the command "insmod g_serial.ko". Someone know if the Altera give drivers to use the OTG as peripheral in the linux? If yes how I can do it? Thanks, Willian Henrique