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.

Config kernel for BeagleBone USB Ethernet Gadget

Other Parts Discussed in Thread: AM1808

Hello,

I have the latest Linux source from TISDK for AM335x version 7.0.0

I failed to config kernel for using Ethernet  over USB by selecting

Device Driver + USB + USB Gadget Support + USB Gadget Drivers + Multifunction Composite Gadget

   + RNDIS + CDC Serial + Storage

    + CDC Ethernet + CDC Serial + Storage

Using compiler GCC-4.7.3 come with the package

Thanks for your help.

~Duy-Ky

  • user4327245 said:
    I failed to config kernel for using Ethernet  over USB

    What failed? menuconfig? or compilation? or kernel runtime?

    BTY, the following wiki explains the kernel USB configuration required for MUSB controller.

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

  • Hello,

    I just did what recommend  for MUSB controller.


    It failed at run time, "ifconfig" gives only "eth0 & lo". When I force "ifconfig usb0", it says

    ifconfig: usb0: error fetching interface information: Device not found

    Thanks for your help

    ~Duy-Ky

  • Please connect the board mini USB port to the host port and run the following scripts and provide the logs.

    0624.usbreg.sh.txt

    7888.chkusb.sh.txt

  • Hi Bin,

    Normally I connected to Windows to use Tera Term there.

    Now I connect to Linux host and got the results below

    ip_15:~/BBONE % suu ./chkusb.sh

    chkusb.sh Version 0.2.0

    Unsupported

    ip_15:~/BBONE % suu ./usbreg.sh

       bus #0:

    Error: unknown platform

       bus #1:

    Error: unknown platform

    ip_15:~/BBONE %

     

    So the results are not good!!! Could I have your answer for the following

    1) I fails to use PuTTY on Linux with serial option "/dev/ttyUSB0 115200". What should I do ?

    Thanks,

     

    ~Duy-Ky

     

  • user4327245 said:

    ip_15:~/BBONE % suu ./chkusb.sh

    chkusb.sh Version 0.2.0

    Unsupported

    I am sorry, I guess BBB uses different signature so the script does not recognize it. Let me fix it and send you the updated script.

    user4327245 said:
    1) I fails to use PuTTY on Linux with serial option "/dev/ttyUSB0 115200". What should I do ?

    Sorry, I don't know, I use minicom on Linux.

  • My BBB does not have a different signature. Please post the log of 'cat /proc/cpuinfo' to let me see why my script failed.


    Please run the scripts attached below using the following command, and provide the logs.

    # PLATFORM=am335x ./chkusb.sh.txt

    # PLATFORM=am335x ./usbreg.sh.txt

    4456.usbreg.sh.txt

    1185.chkusb.sh.txt

  • Hi Bin,

    The capture below

    I'm really surprised that it reports

    /lib/modules/3.13.0-32-generic/kernel/drivers/usb/gadget/:

    and I found NO such folder on the target filesystem!!!

    Thanks,

    ~Duy-Ky

    ######################################################################

    cat /proc/cpuino

    processor : 0

    vendor_id : GenuineIntel

    cpu family : 6

    model : 23

    model name : Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz

    stepping : 10

    microcode : 0xa0b

    cpu MHz : 2925.975

    cache size : 3072 KB

    physical id : 0

    siblings : 2

    core id : 0

    cpu cores : 2

    apicid : 0

    initial apicid : 0

    fdiv_bug : no

    f00f_bug : no

    coma_bug : no

    fpu : yes

    fpu_exception : yes

    cpuid level : 13

    wp : yes

    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dtherm tpr_shadow vnmi flexpriority

    bogomips : 5851.95

    clflush size : 64

    cache_alignment : 64

    address sizes : 36 bits physical, 48 bits virtual

    power management:

    processor : 1

    vendor_id : GenuineIntel

    cpu family : 6

    model : 23

    model name : Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz

    stepping : 10

    microcode : 0xa0b

    cpu MHz : 2925.975

    cache size : 3072 KB

    physical id : 0

    siblings : 2

    core id : 1

    cpu cores : 2

    apicid : 1

    initial apicid : 1

    fdiv_bug : no

    f00f_bug : no

    coma_bug : no

    fpu : yes

    fpu_exception : yes

    cpuid level : 13

    wp : yes

    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dtherm tpr_shadow vnmi flexpriority

    bogomips : 5851.95

    clflush size : 64

    cache_alignment : 64

    address sizes : 36 bits physical, 48 bits virtual

    power management:

    ######################################################################

    usbreg

       bus #0:

    /sys/kernel/debug/musb-hdrc.0.auto/regdump not found

       bus #1:

    /sys/kernel/debug/musb-hdrc.1.auto/regdump not found

    ######################################################################

    chkusb

    chkusb.sh Version 0.2.1

    USB is initialized

    Warning: /proc/device-tree/ not found

    The list of USB gadget drivers installed:

    /lib/modules/3.13.0-32-generic/kernel/drivers/usb/gadget/:

    amd5536udc.ko

    fotg210-udc.ko

    g_acm_ms.ko

    gadgetfs.ko

    g_audio.ko

    g_cdc.ko

    g_dbgp.ko

    g_ether.ko

    g_ffs.ko

    g_hid.ko

    g_mass_storage.ko

    g_midi.ko

    g_ncm.ko

    g_nokia.ko

    goku_udc.ko

    g_printer.ko

    g_serial.ko

    g_webcam.ko

    g_zero.ko

    libcomposite.ko

    mv_u3d_core.ko

    mv_udc.ko

    net2272.ko

    net2280.ko

    pch_udc.ko

    pxa27x_udc.ko

    r8a66597-udc.ko

    tcm_usb_gadget.ko

    udc-core.ko

    u_ether.ko

    u_rndis.ko

    usb_f_acm.ko

    usb_f_ecm.ko

    usb_f_ecm_subset.ko

    usb_f_eem.ko

    usb_f_mass_storage.ko

    usb_f_ncm.ko

    usb_f_obex.ko

    usb_f_phonet.ko

    usb_f_rndis.ko

    usb_f_serial.ko

    usb_f_ss_lb.ko

    u_serial.ko

  • Sorry, I should have said to run those scripts on BBB, not on host.
    Please run them again on BBB.
  • Hi Bin,

    Below is the capture.

    BTW, I check on my AM1808 and it works even with kernel 2.6.33.;-)

    Thanks so much for your help.

    ~Duy-Ky

    ################################################################

    cat /proc/cpuinfo

    processor    : 0
    model name    : ARMv7 Processor rev 2 (v7l)
    Features    : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32
    CPU implementer    : 0x41
    CPU architecture: 7
    CPU variant    : 0x3
    CPU part    : 0xc08
    CPU revision    : 2

    Hardware    : Generic AM33XX (Flattened Device Tree)
    Revision    : 0000
    Serial        : 0000000000000000

    #################################################################

    chkusb.sh

    chkusb.sh Version 0.2.1
    USB is initialized
    usb@48390000: ,
    usb@483d0000: ,

    The gadget driver is built-in
    gadget driver loaded: (none)

    ##############################################################

    usbreg.sh

        bus #0:
    .
    Power       : 20
    DevCtl      : 80
        bus #1:
    .
    Power       : e0
    DevCtl      : 19

  • Sorry, please again use the first version of the scripts (v0.2.0). this one (v0.2.1) was done in a rush and has bug when I added forcing platform support - I will fix it soon. The v0.2.0 should give all the details.

    But v0.2.1 already tells the gadget driver is not loaded. SDKv7.0.0.0 has a known issue which does not support USB gadget driver built into kernel. So you could either build g_ether gadget as module, or use patch #7.1 in wiki http://processors.wiki.ti.com/index.php/Sitara_Linux_MUSB_Issues to fix the known issue so you can build g_ether into zImage.

  • Hi Bin,

    Below is the check using the original scripts.

    I'm not sure what to do with the issues ?

    My guess is to copy all the fixes for version v-7.0.0 into a file and pacth to kernel linux-3.12.10-ti2013.12.01
    Am I correct, if not, what should I do with it ?

    Thanks,

    ~Duy-Ky


    ##################################################
    usbreg.log-0

    bus #0:
    Power : 20
    DevCtl : 80
    bus #1:
    Power : e0
    DevCtl : 19
    ###################################################
    chkusb.log-0

    chkusb.sh Version 0.2.0
    USB is initialized
    usb@47401000: otg, okay
    usb@47401800: host, okay

    The gadget driver is built-in
    gadget driver loaded: (none)
  • user4327245 said:
    The gadget driver is built-in
    gadget driver loaded: (none)

    Here shows the problem - the gadget driver is not bound. As I said SDK v7.0 kernel has a known issue which prevents built-in gadget to bind.

    You have two options to fix the issue.

    - If building in the gadget driver is not a requirement (for example, the USB-Ethernet interface should be ready before kernel mounts the filesystem), you can build g_ether gadget driver as a module, then load the driver module after system mounted the filesystem: modprobe g_ether;

    - If the above option is not applicable, you have to apply patch #7.1 in wiki http://processors.wiki.ti.com/index.php/Sitara_Linux_MUSB_Issues, then you can build the gadget driver into kernel.

  • Hello Bin,

    The patch #7.1 does not match with the target file at arm/boot/dts/am33xx.dtsi in ti linux-3.12 (v7.0)
    I download ti linux 3.14 and not able to patch it, but it's ok to edit to the patch.
    I compiled and I'm not able to bring up g_ether usb.

    So, I use the MODULE option and it works now.

    Thanks so much for your help, Bin

    ~Duy-Ky
  • user4327245 said:
    The patch #7.1 does not match with the target file at arm/boot/dts/am33xx.dtsi in ti linux-3.12 (v7.0)

    The patch has to be manually applied. This community patch was submitted after SDKv7.0 was released but before SDKv8.0 was released, so it can smoothly apply to v8.0 kernel, but has to be manually applied to v7.0 kernel.

    user4327245 said:
    I download ti linux 3.14 and not able to patch it, but it's ok to edit to the patch.
    I compiled and I'm not able to bring up g_ether usb.

    Please ensure all MUSB related drivers are built into kernel, not as module, including the MUSB core (hdrc), cppi, phy drivers.

    I have updated the wiki to describe these details.

    user4327245 said:
    So, I use the MODULE option and it works now.

    I am glad there is an option which works for you.

  • Hello,

    I did manually applied by editing the file and check the match.
    Unfortunately it's NOT working.
    I try with modules and it works.

    I need to do a lot in compiling the kernel to test something, so it's a lot easier if I could use built-in driver.

    Are you aware of any kernel with workable built-in driver and where to get it ?

    Thanks,

    ~Duy-Ky
  • The issue which the patch #7.1 fixes still exists in the latest kernel (v4.2), so you will need this patch anyway.

    I just tested SDK v7.0 and v8.0 kernel, builtin gadget works in both kernels with this patch. The key is to ensure all MUSB related drivers are built-in, not module.

    Please only use zImage you built, don't install all the kernel modules, and run my chkusb.sh script, it will tell if your kernel config is not correct.

  • Hello Bin,

    If it's the case, I should use "insmod" instead of "modprobe" as the latter expects too much, too much "bureaucracy" I have to follow!

    Thanks so so much for your outstanding professional support

    Kind Regards,

    ~Duy-Ky
  • user4327245 said:
    If it's the case, I should use "insmod" instead of "modprobe" as the latter expects too much, too much "bureaucracy" I have to follow!

    FYI, I don't manually use insmod nor modprobe. No matter I used SD card or NFS for the target filesystem, I typically do 'make zImage modules dtbs', then 'make modules_install INSTALL_MOD_PATH=<tgt-filesystem-location>' to install all the kernel modules into the final location. Thanks to the way how kernel probes hw and drivers, all the USB related drivers will be loaded automatically during kernel bootup. I don't have to manually run any command - expect modprobe the gadget driver if it was a module.

    user4327245 said:
    Thanks so so much for your outstanding professional support

    My pleasure.

  • Hello Bin,

    At first, I did what you said; unfortunately it works for ONLY for g_Ether_USB, but not for g_Storage_USB!!!

    I had to spent some effort to find out out I had to load the module manually with some extra argument for what partition I want to mount.
    There must be some better way to do it, but I don't know!

    Thanks for your great help, Bin

    ~Duy-Ky
  • user4327245 said:
    There must be some better way to do it, but I don't know!

    Please refer to https://wiki.archlinux.org/index.php/Kernel_modules#Setting_module_options.

  • It's awesome!
    Thank so much, Bin