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.

AM335x USB Device Mode Configuration with Processor SDK

Hi Team,

We have custom board which is based on design of am335xevm starter kit.

We have mini-usb connected directly to USB0 of the processor.

According to the following guide, we configured the kernel for building RNDIS gadget driver.

processors.wiki.ti.com/.../UsbgeneralpageLinux-v3p1

we have inseted the modules in the following order.

# insmod drivers/usb/core/usbcore.ko

# insmod drivers/usb/gadget/udc/udc-core.ko

# insmod drivers/usb/musb/musb_hdrc.ko

# insmod drivers/usb/musb/am35x.ko

# insmod drivers/usb/gadget/libcomposite.ko

# insmod drivers/usb/gadget/function/usb_f_rndis.ko

# insmod drivers/usb/gadget/legacy/g_ether.ko

After inseting all the modulws, we got the following debug messages.

[ 192.826217] usbcore: registered new interface driver usbfs

[ 192.884624] usbcore: registered new interface driver hub

[ 192.902194] usbcore: registered new device driver usb

insmod: cannot insert 'kernel/drivers/usb/gadget/legacy/g_ether.ko': No such device

# lsmod

Module Size Used by Not tainted

usb_f_rndis 21108 0

libcomposite 47218 1 usb_f_rndis

u_ether 14661 1 usb_f_rndis

gadgetfs 17982 0

am35x 5394 0

musb_hdrc 68793 1 am35x

udc_core 11604 3 libcomposite,gadgetfs,musb_hdrc

usbcore 189805 1 musb_hdrc

we are not getting any USB0 interface. We have attached config file for your reference.

Do we need to make any changes in dts file?

Kindly guide us to proceed further.

Thanks & Regards,

Arun

6457.config.txt

  • Hi,

    The wiki page you refer is very old. This is the wiki for the current SDK: processors.wiki.ti.com/.../Linux_Core_MUSB_User's_Guide
  • Hi Biser,

    Thanks for your quick response.
    I have already referred that wiki too. since usb interface is working fine in ti-sdk-05.05.00.00,
    I want to know the exact configuration made for usb in latest processor SDK-02.00.02.11.


    Thanks & Regards,
    Arun
  • Arun,

    If you follow the StarterKit dts file and don't change any usb related nodes, your usb should work just fine.

    By default, all those usb related kernel modules should be loaded automatically after kernel boots up, I am not sure why you have to insmod each individuals. But at first, I spot an error you did.

    Arun said:
    # insmod drivers/usb/musb/am35x.ko

    It should be 'musb_dsps.ko' instead. am35x.ko is not for am335x device.

  • Hi Bin,

    As you suggested, i have followed StarterKit dts file and the default kernel configuration.

    I still got the following error when i inserted RNDIS driver.

    I'm using processor-sdk-02.00.02.11. I have attached my config file also.

    insmod kernel/drivers/usb/gadget/legacy/g_ether.ko

    [ 1002.681970] g_ether musb-hdrc.0.auto: failed to start g_ether: -2

    insmod: cannot insert 'kernel/drivers/usb/gadget/legacy/g_ether.ko': unknown symbol in module

    # lsmod

    Module                           Size    Used by    Not tainted

    musb_am335x             1240     0               [permanent]

    musb_dsps                   7807     0

    musb_hdrc                 68793     1               musb_dsps

    usb_f_rndis              21108       0

    u_ether                      14661      1                 usb_f_rndis

    libcomposite           47218      1                  usb_f_rndis

    udc_core                  11604      2                   musb_hdrc,libcomposite

    usbcore                  189805      1                   musb_hdrc

    I referred the following link to check the USB configuration.

    http://processors.wiki.ti.com/index.php/MUSB_Linux_Driver_Configuration

    Thanks & Regards

    Arun

    1325.config.txt

  • Arun said:

    insmod: cannot insert 'kernel/drivers/usb/gadget/legacy/g_ether.ko': unknown symbol in module

    It seems you didn't install the kernel modules properly.

    After you built the kernel zImage and kernel modules, you have to use 'make modules_install' to install the modules into your filesystem.

  • Arun said:
    insmod kernel/drivers/usb/gadget/legacy/g_ether.ko

    Please use 'modprobe g_ether' instead. insmod command does not solve module dependencies.

  • Hi Bin,

    I tried the command recommended by you and got the following error.

    # modprobe g_ether
    modprobe: module g_ether not found
    modprobe: failed to load module g_ether: No such file or directory

    # ls -l kernel/drivers/usb/gadget/legacy/g_ether.ko
    -rw-r--r-- 1 root root 182741 Jun  8  2016 kernel/drivers/usb/gadget/legacy/g_ether.ko

    I checked the following link for configuring USB RNDIS driver.

    http://processors.wiki.ti.com/index.php/Sitara_Linux_Add_USB_Ethernet_Gadget_to_Linux_Kernel

    My kenel was also configured according to the above link, but still i didn't get any USB0 interface.

    I have two queries.

    1.  AM335x-EVM starter kit uses kernel/drivers/usb/gadget/legacy/g_multi.ko for creating USB0 interface.

         I'm using kernel/drivers/usb/gadget/legacy/g_ether.ko for USB0 interface. Is there any difference?

    2. In AM335x-EVM starter kit, a number of ko modules are inserted automatically on-boot.

        can i know what is the script file that inserts all the .ko modules on-boot?

    Thanks & Regards

    Arun