This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Does AM335x Linux USB Gadget Mode support HID, Printer mode?

Hi,

Have AM335x Linux PSP support HID Gadget and Printer Gadget mode?

In AM335x linux USB driver guide, current only support Mass storage Class, RNDIS, CDC mode.

Have any plan to support these mode?

Or, have any suggest to help modify usb gadget driver? 

Thanks a lot.

Shine Kao

  • HID and Printer gadget is not tested but they should work. Please post the details if you face any issue.

    Ajay

  • Hi Ajay,

    Currently I rebuild the kernel uImage,

    add some kernel configuration see below list

     USB Support ---> Remove "USB Mass Storage support"

                                    Add "USB Gadget Support --> USB Gadget Drivers (HID Gadget)"

    Then make the kernel, but get below error message

    scripts/kconfig/conf --silentoldconfig Kconfig
      CHK     include/linux/version.h
      CHK     include/generated/utsrelease.h
    make[1]: `include/generated/mach-types.h' is up to date.
      CALL    scripts/checksyscalls.sh
      CHK     include/generated/compile.h
      GZIP    kernel/config_data.gz
      CHK     kernel/config_data.h
      LD      drivers/usb/gadget/built-in.o
    drivers/usb/gadget/g_dbgp.o: In function `usb_ep_autoconfig':
    dbgp.c:(.text+0xb84): multiple definition of `usb_ep_autoconfig'
    drivers/usb/gadget/g_hid.o:hid.c:(.text+0x334c): first defined here
    drivers/usb/gadget/g_dbgp.o: In function `usb_ep_autoconfig_reset':
    dbgp.c:(.text+0xb9c): multiple definition of `usb_ep_autoconfig_reset'
    drivers/usb/gadget/g_hid.o:hid.c:(.text+0x3364): first defined here
    drivers/usb/gadget/g_dbgp.o: In function `usb_ep_autoconfig_ss':
    dbgp.c:(.text+0xa10): multiple definition of `usb_ep_autoconfig_ss'
    drivers/usb/gadget/g_hid.o:hid.c:(.text+0x31d8): first defined here
    make[3]: *** [drivers/usb/gadget/built-in.o] Error 1
    make[2]: *** [drivers/usb/gadget] Error 2
    make[1]: *** [drivers/usb] Error 2
    make: *** [drivers] Error

    Are you willing to guide me to solve this issue?

    Shine

  • You can refer below page for this

    [1] http://processors.wiki.ti.com/index.php/UsbConfigControllerDriver

    [2] http://processors.wiki.ti.com/index.php/UsbConfigDevCDC  [select HID or Printer gadget instead]

    Regards,
    Ajay

  • Hi Ajay,

    I follow the UsbCongigDevCDC page to select HID

    <*> USB Peripheral Controller (Inventra HDRC USB Peripheral (TI, ADI, ...)) --->

    <*> USB Gadget Drivers (HID Gadget)

           (X) HID Gadget

    Then build the kernel image, will occur below error.

    LD      drivers/usb/gadget/built-in.odrivers/usb/gadget/g_dbgp.o

    drivers/usb/gadget/g_dbgp.o: In function `usb_ep_autoconfig':
    dbgp.c:(.text+0xb84): multiple definition of `usb_ep_autoconfig'
    drivers/usb/gadget/g_hid.o:hid.c:(.text+0x334c): first defined here
    drivers/usb/gadget/g_dbgp.o: In function `usb_ep_autoconfig_reset':
    dbgp.c:(.text+0xb9c): multiple definition of `usb_ep_autoconfig_reset'
    drivers/usb/gadget/g_hid.o:hid.c:(.text+0x3364): first defined here
    drivers/usb/gadget/g_dbgp.o: In function `usb_ep_autoconfig_ss':
    dbgp.c:(.text+0xa10): multiple definition of `usb_ep_autoconfig_ss'
    drivers/usb/gadget/g_hid.o:hid.c:(.text+0x31d8): first defined here
    make[3]: *** [drivers/usb/gadget/built-in.o] Error 1
    make[2]: *** [drivers/usb/gadget] Error 2
    make[1]: *** [drivers/usb] Error 2
    make: *** [drivers] Error 2
    cp: cannot stat `/home/user/ti-sdk-am335x-evm-05.03.02.00/board-support/linux-3.1.0-psp04.06.00.03.sdk/arch/arm/boot/uImage': No such file or directory

    If I select below list item,

    <M> USB Gadget Drivers

    <M> HID Gadget

    The build process will succes,  but on drivers/usb/gadget

    I only see below *.o files

    built-in.o
    dbgp.o
    g_dbgp.o
    udc-core.o

    I can't find xxx.ko

    If I want insert HID gadget module,What shall I do?

    Shine.

  • Hi Ajay,

    Would you help us to test the HID gadget driver on AM335x?

    Best regards,

    Shine

  • Shine,

    As I know gadgets must be built as kernel modules. Just ethernet gadget can be built-in in kernel image. Maybe something has changed in recent kernels, I do not know, but for sure no more than a single gadget can be built-in at a time. So your kernel configuration is quite surprising...

    In any case I suggest to build them as modules. You need to make targets modules and modules_install, see wiki on how to. Then you can load/unload them at run time, or at init with some init scripts. Hope this can help.

    I also suggest to write about these "generic" topics on Linux forum, more than on platform-specific forums.

    Regards

    Max

  • Shine,

    please share the .config from you source tree.

    Ajay

  • Ajay,

    Please see attache file.

    shine

  • Hi,

    We already solved this issue by register to kernel.