Talk:USB Gadget

From ArmadeusWiki
Jump to: navigation, search

Installation

  • configure your Linux kernel:
$ make linux26-menuconfig
Device Drivers  --->
    [*] USB support  --->
        <M>   USB Gadget Support  --->
  • and activate all USB Gadget drivers you need:

Linux config usb gadget.png

  • save your configuration and then rebuild your kernel image:
 $ make

now you should have the following drivers in your kernel source tree:

/lib/modules/`uname -r`/kernel/drivers/usb/gadget/gadgetfs.ko        For test
/lib/modules/`uname -r`/kernel/drivers/usb/gadget/g_ether.ko         Ethernet emulation on USB
/lib/modules/`uname -r`/kernel/drivers/usb/gadget/g_file_storage.ko  Mass storage
/lib/modules/`uname -r`/kernel/drivers/usb/gadget/g_serial.ko        Serial emulation on USB
/lib/modules/`uname -r`/kernel/drivers/usb/gadget/g_zero.ko          For test
/lib/modules/`uname -r`/kernel/drivers/usb/gadget/imx_udc.ko         i.MXL USB device Core Controller 
  • reflash your RootFS or manually copy imx_udc.ko, g_file_storage.ko & g_serial.ko to your target in /lib/modules/...

Usage

First, load the core controller driver on your board:

# modprobe imx_udc
 usb: imx_udc version: 0.5