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.

Linux/AM3352: Problems enabling USB Ethernet

Part Number: AM3352

Tool/software: Linux


Hi

I am looking for help in understanding how to enable USB-Ethernet in a kernel running on an am335x.

I am using a board derived from the BeagleBoneBlack presently running ti-processor-sdk-linux-am335x-evm-03.02.00.05-Linux-x86-Install.bin (using the kernel linux-4.4.19+gitAUTOINC+db0b54cdad-gdb0b54cdad)

The main constraints of the board are storage space (so the ROOTFS is minimal and will mostly be read only)
- and that there is no physical ethernet port on the board; which is why I am looking to enable USB-Ethernet

I have been digging about in the Sitara documentation and gleaning what I can about the process.
I have followed the instructions from processors.wiki.ti.com/.../Sitara_Linux_Program_the_eMMC_on_Beaglebone_Black
- to enable what I believe to be the necessary drivers and build them in to the kernel

This changes in menuconfig ended up looking like:

─────────────────────────────────────────────────────────────────────────
--- USB Gadget Support 
[ ] Debugging messages (DEVELOPMENT) 
[ ] Debugging information files (DEVELOPMENT) 
[ ] Debugging information files in debugfs (DEVELOPMENT) 
(2) Maximum VBUS Power usage (2-500 mA) 
(32) Number of storage pipeline buffers 
USB Peripheral Controller ---> 
<*> USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet support)) ---> 
Ethernet Gadget (with CDC Ethernet support) 
[*] RNDIS support 
[ ] Ethernet Emulation Model (EEM) support

and 

< > Microtek X6USB scanner support │ │ 
< > USB/IP support │ │ 
<*> Inventra Highspeed Dual Role Controller (TI, ADI, AW, ...) │ │ 
MUSB Mode Selection (Gadget only mode) ---> │ │ 
*** Platform Glue Layer *** │ │ 
< > TUSB6010 │ │ 
< > OMAP2430 and onwards │ │ 
< > AM35x │ │ 
<*> TI DSPS platforms │ │ 
*** MUSB DMA mode *** │ │ 
[*] Disable DMA (always use PIO) │ │ 
<M> DesignWare USB3 DRD Core Support │ │ 
DWC3 Mode Selection (Dual Role mode) --->


After which the kernel boots with the following:

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.19-gdb0b54cdad (richard@richard-ubvm) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #146 PREEMPT Fri May 5 16:36:30 AEST 2017
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Compumedics Argo
[ 0.000000] cma: Reserved 24 MiB at 0x8d000000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM335X ES2.1 (neon )
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 64960
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=PARTUUID=b2422e7c-02 rw rootfstype=ext4 rootwait
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 224924K/262144K available (6619K kernel code, 316K rwdata, 2348K rodata, 268K init, 297K bss, 12644K reserved, 24576K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc08ca01c (8969 kB)
[ 0.000000] .init : 0xc08cb000 - 0xc090e000 ( 268 kB)
[ 0.000000] .data : 0xc090e000 - 0xc095d3d0 ( 317 kB)
[ 0.000000] .bss : 0xc095d3d0 - 0xc09a78d8 ( 298 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] OMAP clockevent source: timer2 at 25000000 Hz
[ 0.000019] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 85899345900ns
[ 0.000044] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
[ 0.000058] OMAP clocksource: timer1 at 25000000 Hz
[ 0.000263] clocksource_probe: no matching clocksources found
[ 0.000485] Console: colour dummy device 80x30
[ 0.000519] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[ 0.000527] This ensures that you still see kernel messages. Please
[ 0.000534] update your kernel commandline.
[ 0.000555] Calibrating delay loop... 623.41 BogoMIPS (lpj=3117056)
[ 0.048855] pid_max: default: 32768 minimum: 301
[ 0.049013] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.049029] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.049906] Initializing cgroup subsys io
[ 0.049946] Initializing cgroup subsys memory
[ 0.049994] Initializing cgroup subsys devices
[ 0.050013] Initializing cgroup subsys freezer
[ 0.050031] Initializing cgroup subsys perf_event
[ 0.050047] Initializing cgroup subsys pids
[ 0.050086] CPU: Testing write buffer coherency: ok
[ 0.050586] Setting up static identity map for 0x80008200 - 0x80008258
[ 0.053314] devtmpfs: initialized
[ 0.068635] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 0.087373] omap_hwmod: debugss: _wait_target_disable failed
[ 0.145280] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.148028] pinctrl core: initialized pinctrl subsystem
[ 0.149870] NET: Registered protocol family 16
[ 0.152553] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.178849] cpuidle: using governor ladder
[ 0.208837] cpuidle: using governor menu
[ 0.214577] OMAP GPIO hardware version 0.1
[ 0.227796] hw-breakpoint: debug architecture 0x4 unsupported.
[ 0.269755] edma 49000000.edma: TI EDMA DMA engine driver
[ 0.274825] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[ 0.275005] media: Linux media interface: v0.10
[ 0.275086] Linux video capture interface: v2.00
[ 0.275158] pps_core: LinuxPPS API ver. 1 registered
[ 0.275168] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.275213] PTP clock support registered
[ 0.275292] EDAC MC: Ver: 3.0.0
[ 0.276764] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[ 0.278579] clocksource: Switched to clocksource timer1
[ 0.292684] NET: Registered protocol family 2
[ 0.293671] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.293720] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.293755] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.293849] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.293873] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.294065] NET: Registered protocol family 1
[ 0.294589] RPC: Registered named UNIX socket transport module.
[ 0.294607] RPC: Registered udp transport module.
[ 0.294616] RPC: Registered tcp transport module.
[ 0.294624] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.295815] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[ 0.298279] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.309372] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.310595] NFS: Registering the id_resolver key type
[ 0.310678] Key type id_resolver registered
[ 0.310690] Key type id_legacy registered
[ 0.310786] ntfs: driver 2.1.32 [Flags: R/O].
[ 0.311156] jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[ 0.316030] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[ 0.316071] io scheduler noop registered
[ 0.316089] io scheduler deadline registered
[ 0.316143] io scheduler cfq registered (default)
[ 0.317892] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 0.399598] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
[ 0.404952] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
[ 0.975282] console [ttyS0] enabled
[ 0.980348] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 159, base_baud = 3000000) is a 8250
[ 0.990401] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 160, base_baud = 3000000) is a 8250
[ 1.000257] [drm] Initialized drm 1.1.0 20060810
[ 1.014464] loop: module loaded
[ 1.023895] libphy: Fixed MDIO Bus: probed
[ 1.088669] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[ 1.094571] davinci_mdio 4a101000.mdio: no live phy, scanning all
[ 1.100814] davinci_mdio: probe of 4a101000.mdio failed with error -5
[ 1.121631] cpsw 4a100000.ethernet: Detected MACID = 98:5d:ad:4e:d2:5e
[ 1.145739] 47401300.usb-phy supply vcc not found, using dummy regulator
[ 1.182988] 47401b00.usb-phy supply vcc not found, using dummy regulator
[ 1.229804] using random self ethernet address
[ 1.234123] using random host ethernet address
[ 1.239323] usb0: HOST MAC 96:96:f9:53:68:1b
[ 1.243592] usb0: MAC be:be:f1:5e:18:f1
[ 1.247341] using random self ethernet address
[ 1.251682] using random host ethernet address
[ 1.256084] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[ 1.262556] g_ether gadget: g_ether ready
[ 1.267137] mousedev: PS/2 mouse device common for all mice
[ 1.273557] i2c /dev entries driver
[ 1.278476] cpuidle: enable-method property 'ti,am3352' found operations
[ 1.286363] omap_hsmmc 48060000.mmc: Got CD GPIO
[ 1.365962] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.375734] mmc0: new high speed SDHC card at address 59b4
[ 1.382004] mmcblk0: mmc0:59b4 1.84 GiB 
[ 1.388054] mmcblk0: p1 p2
[ 1.450884] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.468847] NET: Registered protocol family 10
[ 1.479845] sit: IPv6 over IPv4 tunneling driver
[ 1.485309] NET: Registered protocol family 17
[ 1.509007] Key type dns_resolver registered
[ 1.513348] omap_voltage_late_init: Voltage driver support not added
[ 1.556366] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[ 1.568955] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[ 1.575638] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[ 1.599875] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 625000 KHz
[ 1.606987] cpu cpu0: dev_pm_opp_domain_set_rate: failed to find current OPP for freq 625000000 (-34)
[ 1.640050] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 600000 KHz
[ 1.649274] hctosys: unable to open rtc device (rtc0)
[ 1.694139] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.708676] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.729576] devtmpfs: mounted
[ 1.732931] Freeing unused kernel memory: 268K (c08cb000 - c090e000)
[ 1.748582] This architecture does not have kernel memory protection.
init started: BusyBox v1.24.1 (2017-02-09 12:59:11 AEDT)
[ 1.926299] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
starting pid 61, tty '': '/etc/init.d/rcS'
starting pid 93, tty '/dev/ttyS0': '/sbin/getty 115200 ttyS0'

I get the impression form this that it is almost bringing eveything up correctly

The problem is that the device is not recognised by my windows PC
- not even sufficiently to pass it through to the Virtual Linux box that I am using for development

What i can see:

-  from device manager:

Windows has stopped this device because it has reported problems. (Code 43)
A request for the USB device descriptor failed.

A subset of the information available from USB Device Tree Viewer:

=========================== USB Port10 ===========================
Connection Status : 0x02 (Device failed enumeration)
Device Description : Unknown USB Device (Device Descriptor Request Failed)
Device Path : \\.\usb#vid_0000&pid_0002#5&33eb7b70&0&10#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Device ID : USB\VID_0000&PID_0002\5&33EB7B70&0&10
Hardware IDs : USB\DEVICE_DESCRIPTOR_FAILURE
Driver KeyName : {36fc9e60-c465-11cf-8056-444553540000}\0022 (GUID_DEVCLASS_USB)

For comparison when I run the am335xEVM or beaglebone I can see a HUB attached both to a Composite device and Serial device

It is likely that I have compromised the VID of how the board presents over USB?

I would be grateful for any suggestions for how to go about debugging this further

Thanks for any help.
Best regards,
Richard

  • Hi

    the full debug output form the kernel boot is as follows:

    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Initializing cgroup subsys cpuacct
    [    0.000000] Linux version 4.4.19-gdb0b54cdad (richard@richard-ubvm) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #153 PREEMPT Tue Jun 13 12:20:14 AEST 2017
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine model: Compumedics Argo
    [    0.000000] cma: Reserved 24 MiB at 0x8d000000
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] On node 0 totalpages: 65536
    [    0.000000] free_area_init_node: node 0, pgdat c094ac0c, node_mem_map cfdad000
    [    0.000000]   Normal zone: 576 pages used for memmap
    [    0.000000]   Normal zone: 0 pages reserved
    [    0.000000]   Normal zone: 65536 pages, LIFO batch:15
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM335X ES2.1 (neon )
    [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
    [    0.000000] pcpu-alloc: [0] 0 
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64960
    [    0.000000] Kernel command line: console=ttyO0,115200n8 DEBUG root=PARTUUID=b2422e7c-02 rw rootfstype=ext4 rootwait
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 224984K/262144K available (6575K kernel code, 316K rwdata, 2332K rodata, 264K init, 296K bss, 12584K reserved, 24576K cma-reserved, 0K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc08bb01c   (8909 kB)
    [    0.000000]       .init : 0xc08bc000 - 0xc08fe000   ( 264 kB)
    [    0.000000]       .data : 0xc08fe000 - 0xc094d050   ( 317 kB)
    [    0.000000]        .bss : 0xc094d050 - 0xc0997258   ( 297 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000]  Build-time adjustment of leaf fanout to 32.
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [    0.000000] OMAP clockevent source: timer2 at 25000000 Hz
    [    0.000019] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 85899345900ns
    [    0.000046] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
    [    0.000061] OMAP clocksource: timer1 at 25000000 Hz
    [    0.000282] clocksource_probe: no matching clocksources found
    [    0.000507] Console: colour dummy device 80x30
    [    0.000540] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [    0.000548] This ensures that you still see kernel messages. Please
    [    0.000555] update your kernel commandline.
    [    0.000577] Calibrating delay loop... 623.41 BogoMIPS (lpj=3117056)
    [    0.048852] pid_max: default: 32768 minimum: 301
    [    0.049011] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.049027] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.049907] Initializing cgroup subsys io
    [    0.049947] Initializing cgroup subsys memory
    [    0.049996] Initializing cgroup subsys devices
    [    0.050016] Initializing cgroup subsys freezer
    [    0.050034] Initializing cgroup subsys perf_event
    [    0.050049] Initializing cgroup subsys pids
    [    0.050091] CPU: Testing write buffer coherency: ok
    [    0.050588] Setting up static identity map for 0x80008200 - 0x80008258
    [    0.053326] devtmpfs: initialized
    [    0.069055] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    0.087456] omap_hwmod: debugss: _wait_target_disable failed
    [    0.145364] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.148088] pinctrl core: initialized pinctrl subsystem
    [    0.149906] NET: Registered protocol family 16
    [    0.152631] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.178844] cpuidle: using governor ladder
    [    0.208832] cpuidle: using governor menu
    [    0.214248] gpiochip_add: registered GPIOs 0 to 31 on device: gpio
    [    0.214648] OMAP GPIO hardware version 0.1
    [    0.215618] gpiochip_add: registered GPIOs 32 to 63 on device: gpio
    [    0.216628] gpiochip_add: registered GPIOs 64 to 95 on device: gpio
    [    0.217597] gpiochip_add: registered GPIOs 96 to 127 on device: gpio
    [    0.228154] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.269746] edma 49000000.edma: TI EDMA DMA engine driver
    [    0.270233] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulator@0[0]'
    [    0.270705] of_get_named_gpiod_flags: parsed 'gpio' property of node '/fixedregulator@2[0]' - status (0)
    [    0.274889] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
    [    0.275075] media: Linux media interface: v0.10
    [    0.275153] Linux video capture interface: v2.00
    [    0.275227] pps_core: LinuxPPS API ver. 1 registered
    [    0.275238] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.275278] PTP clock support registered
    [    0.275358] EDAC MC: Ver: 3.0.0
    [    0.276835] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
    [    0.278667] clocksource: Switched to clocksource timer1
    [    0.292797] NET: Registered protocol family 2
    [    0.293789] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.293836] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.293871] TCP: Hash tables configured (established 2048 bind 2048)
    [    0.293972] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.293997] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.294194] NET: Registered protocol family 1
    [    0.294701] RPC: Registered named UNIX socket transport module.
    [    0.294719] RPC: Registered udp transport module.
    [    0.294727] RPC: Registered tcp transport module.
    [    0.294736] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.294777] PCI: CLS 0 bytes, default 64
    [    0.295941] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [    0.298421] futex hash table entries: 256 (order: -1, 3072 bytes)
    [    0.309529] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.310723] NFS: Registering the id_resolver key type
    [    0.310809] Key type id_resolver registered
    [    0.310819] Key type id_legacy registered
    [    0.310917] ntfs: driver 2.1.32 [Flags: R/O].
    [    0.311297] jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
    [    0.316219] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
    [    0.316259] io scheduler noop registered
    [    0.316278] io scheduler deadline registered
    [    0.316330] io scheduler cfq registered (default)
    [    0.318084] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [    0.400067] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    [    0.405443] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
    [    0.976348] console [ttyS0] enabled
    [    0.981381] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 159, base_baud = 3000000) is a 8250
    [    0.991464] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 160, base_baud = 3000000) is a 8250
    [    1.001345] [drm] Initialized drm 1.1.0 20060810
    [    1.007037] panel panel: GPIO lookup for consumer enable
    [    1.007059] panel panel: using device tree for GPIO lookup
    [    1.007077] of_get_named_gpiod_flags: can't parse 'enable-gpios' property of node '/panel[0]'
    [    1.007091] of_get_named_gpiod_flags: can't parse 'enable-gpio' property of node '/panel[0]'
    [    1.007103] panel panel: using lookup tables for GPIO lookup
    [    1.007117] panel panel: lookup for GPIO enable failed
    [    1.015985] loop: module loaded
    [    1.025405] libphy: Fixed MDIO Bus: probed
    [    1.088758] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [    1.094661] davinci_mdio 4a101000.mdio: no live phy, scanning all
    [    1.100914] davinci_mdio: probe of 4a101000.mdio failed with error -5
    [    1.121774] cpsw 4a100000.ethernet: Detected MACID = 98:5d:ad:4e:d2:5e
    [    1.145639] am335x-phy-driver 47401300.usb-phy: GPIO lookup for consumer reset
    [    1.145672] am335x-phy-driver 47401300.usb-phy: using device tree for GPIO lookup
    [    1.145693] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [    1.145708] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [    1.145721] am335x-phy-driver 47401300.usb-phy: using lookup tables for GPIO lookup
    [    1.145735] am335x-phy-driver 47401300.usb-phy: lookup for GPIO reset failed
    [    1.145750] am335x-phy-driver 47401300.usb-phy: GPIO lookup for consumer vbus-detect
    [    1.145762] am335x-phy-driver 47401300.usb-phy: using device tree for GPIO lookup
    [    1.145774] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpios' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [    1.145788] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpio' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [    1.145800] am335x-phy-driver 47401300.usb-phy: using lookup tables for GPIO lookup
    [    1.145813] am335x-phy-driver 47401300.usb-phy: lookup for GPIO vbus-detect failed
    [    1.145889] 47401300.usb-phy supply vcc not found, using dummy regulator
    [    1.181098] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [    1.181123] musb-hdrc: MHDRC RTL version 2.0 
    [    1.181134] musb-hdrc: setup fifo_mode 4
    [    1.181161] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [    1.182813] am335x-phy-driver 47401b00.usb-phy: GPIO lookup for consumer reset
    [    1.182842] am335x-phy-driver 47401b00.usb-phy: using device tree for GPIO lookup
    [    1.182860] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
    [    1.182875] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
    [    1.182888] am335x-phy-driver 47401b00.usb-phy: using lookup tables for GPIO lookup
    [    1.182903] am335x-phy-driver 47401b00.usb-phy: lookup for GPIO reset failed
    [    1.182918] am335x-phy-driver 47401b00.usb-phy: GPIO lookup for consumer vbus-detect
    [    1.182929] am335x-phy-driver 47401b00.usb-phy: using device tree for GPIO lookup
    [    1.182942] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpios' property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
    [    1.182955] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpio' property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
    [    1.182967] am335x-phy-driver 47401b00.usb-phy: using lookup tables for GPIO lookup
    [    1.182980] am335x-phy-driver 47401b00.usb-phy: lookup for GPIO vbus-detect failed
    [    1.183049] 47401b00.usb-phy supply vcc not found, using dummy regulator
    [    1.220956] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [    1.220981] musb-hdrc: MHDRC RTL version 2.0 
    [    1.220992] musb-hdrc: setup fifo_mode 4
    [    1.221013] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [    1.229787] udc musb-hdrc.0.auto: registering UDC driver [g_ether]
    [    1.229922] using random self ethernet address
    [    1.234226] using random host ethernet address
    [    1.239435] usb0: HOST MAC 72:05:bb:de:a6:c2
    [    1.243708] usb0: MAC 66:a4:a3:1e:49:ec
    [    1.247453] using random self ethernet address
    [    1.251794] using random host ethernet address
    [    1.256111] g_ether gadget: adding config #2 'RNDIS'/c093ce5c
    [    1.256147] rndis_register: configNr = 0
    [    1.256161] g_ether gadget: adding 'rndis'/cf482b40 to config 'RNDIS'/c093ce5c
    [    1.256197] rndis_set_param_medium: 0 0
    [    1.256210] g_ether gadget: RNDIS: dual speed IN/ep1in OUT/ep1out NOTIFY/ep2in
    [    1.256224] g_ether gadget: cfg 2/c093ce5c speeds: high full
    [    1.256234] g_ether gadget:   interface 0 = rndis/cf482b40
    [    1.256244] g_ether gadget:   interface 1 = rndis/cf482b40
    [    1.256261] g_ether gadget: adding config #1 'CDC Ethernet (ECM)'/c093cdb0
    [    1.256279] g_ether gadget: adding 'cdc_ethernet'/cf482c00 to config 'CDC Ethernet (ECM)'/c093cdb0
    [    1.256315] g_ether gadget: CDC Ethernet: dual speed IN/ep1in OUT/ep1out NOTIFY/ep2in
    [    1.256327] g_ether gadget: cfg 1/c093cdb0 speeds: high full
    [    1.256338] g_ether gadget:   interface 0 = cdc_ethernet/cf482c00
    [    1.256349] g_ether gadget:   interface 1 = cdc_ethernet/cf482c00
    [    1.256369] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
    [    1.262834] g_ether gadget: g_ether ready
    [    1.266709] g_ether musb-hdrc.0.auto: usb_gadget_udc_start
    [    1.267421] mousedev: PS/2 mouse device common for all mice
    [    1.273820] i2c /dev entries driver
    [    1.278978] cpuidle: enable-method property 'ti,am3352' found operations
    [    1.286450] omap_hsmmc 48060000.mmc: GPIO lookup for consumer cd
    [    1.286473] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
    [    1.286514] of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/ocp/mmc@48060000[0]' - status (0)
    [    1.286614] omap_hsmmc 48060000.mmc: Got CD GPIO
    [    1.291200] omap_hsmmc 48060000.mmc: GPIO lookup for consumer wp
    [    1.291215] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
    [    1.291230] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@48060000[0]'
    [    1.291243] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@48060000[0]'
    [    1.291256] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
    [    1.291270] omap_hsmmc 48060000.mmc: lookup for GPIO wp failed
    [    1.329571] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer cd
    [    1.329601] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
    [    1.329619] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@481d8000[0]'
    [    1.329633] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@481d8000[0]'
    [    1.329645] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
    [    1.329659] omap_hsmmc 481d8000.mmc: lookup for GPIO cd failed
    [    1.329675] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer wp
    [    1.329687] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
    [    1.329699] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@481d8000[0]'
    [    1.329711] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@481d8000[0]'
    [    1.330803] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
    [    1.330817] omap_hsmmc 481d8000.mmc: lookup for GPIO wp failed
    [    1.366065] mmc0: host does not support reading read-only switch, assuming write-enable
    [    1.375841] mmc0: new high speed SDHC card at address 59b4
    [    1.382121] mmcblk0: mmc0:59b4       1.84 GiB 
    [    1.387879]  mmcblk0: p1 p2
    [    1.449603] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led@2[0]' - status (0)
    [    1.449934] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led@3[0]' - status (0)
    [    1.450126] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led@4[0]' - status (0)
    [    1.450288] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led@5[0]' - status (0)
    [    1.450973] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.458645] NET: Registered protocol family 10
    [    1.479891] sit: IPv6 over IPv4 tunneling driver
    [    1.485337] NET: Registered protocol family 17
    [    1.499130] Key type dns_resolver registered
    [    1.503492] omap_voltage_late_init: Voltage driver support not added
    [    1.556453] tps65217 0-0024: TPS65217 ID 0xe version 1.2
    [    1.569035] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
    [    1.575717] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [    1.599985] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 625000 KHz
    [    1.607095] cpu cpu0: dev_pm_opp_domain_set_rate: failed to find current OPP for freq 625000000 (-34)
    [    1.640137] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 600000 KHz
    [    1.649378] hctosys: unable to open rtc device (rtc0)
    [    1.692468] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    1.708770] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [    1.729695] devtmpfs: mounted
    [    1.733044] Freeing unused kernel memory: 264K (c08bc000 - c08fe000)
    [    1.748673] This architecture does not have kernel memory protection.
    [    1.926162] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
    [    3.376853] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
    [    3.480548] g_ether gadget: suspend

    so it looks as though there is some activity around the USB and g_ether without any obvious errors being thrown:

    it also appears that there is an interface available

    root@elle-board:~# ip link show
    1: lo: <LOOPBACK> mtu 65536 qdisc noop qlen 1
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
        link/ether 98:5d:ad:4e:d2:5e brd ff:ff:ff:ff:ff:ff
    3: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
        link/ether 66:a4:a3:1e:49:ec brd ff:ff:ff:ff:ff:ff
    4: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1
        link/sit 0.0.0.0 brd 0.0.0.0
    root@elle-board:~# 

    root@elle-board:~# ifconfig usb0 192.168.1.2 netmask 255.255.255.0 up
    root@elle-board:~# ifconfig
    usb0 Link encap:Ethernet HWaddr 66:A4:A3:1E:49:EC
    inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    which puts me to thinking that the issue is low in the USB stack rather than in the gadget configuration itself?

    • I will try and hunt for places to inject some further debug
    • if anyone had any suggestions for something to try I would be really grateful

    All the best,

    Richard

  • Hi
    I have also found this page: processors.wiki.ti.com/.../MUSB_Linux_Driver_Configuration

    Towards the end of this is the comment:
    "Known Issue: the built-in gadget driver is not functional."

    Is this page out of date in this respect?

    Thanks
    - Richard
  • Hi Richard,

    That looks like old wiki. But not sure if it is fixed. But you anyway have your g_ether as module right ? Not built inside kernel ? Can you check what is the dmesg logs in the PC side ?

    There is g_ether: suspend log, in the dmesg.

    Do you need a composite device ? Can you try enabling only the g_ether alone and no other USB gadget device like Mouse/HID etc
  • Hi Dwarakesh

    thanks for the quick reply

    I am trying to build g_ether in to the kernel - the dmesg output was running with this configuration

    Dwarakesh R said:


    Do you need a composite device ? Can you try enabling only the g_ether alone and no other USB gadget device like Mouse/HID etc

    I think I have already done this:
    <*> USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet support)) ---> 
    Ethernet Gadget (with CDC Ethernet support)

    I am hoping only to get g_ether working

    At present my linux dev environment is running as a VM on a windows 10 pc:
    - the USB device presented by my board does not enumerate sufficiently for me to be able to pass it through to the VM

    The information I have about it as far as the host is concerned is:

        =========================== USB Port10 ===========================
    
    Connection Status        : 0x02 (Device failed enumeration)
    Port Chain               : 1-10
    Properties               : 0x01
     IsUserConnectable       : yes
     PortIsDebugCapable      : no
     PortHasMultiCompanions  : no
     PortConnectorIsTypeC    : no
    
          ======================== USB Device ========================
    
            +++++++++++++++++ Device Information ++++++++++++++++++
    Device Description       : Unknown USB Device (Device Descriptor Request Failed)
    Device Path              : \\.\usb#vid_0000&pid_0002#5&33eb7b70&0&10#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
    Device ID                : USB\VID_0000&PID_0002\5&33EB7B70&0&10
    Hardware IDs             : USB\DEVICE_DESCRIPTOR_FAILURE
    Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0022 (GUID_DEVCLASS_USB)
    Driver Inf               : C:\WINDOWS\inf\usb.inf
    Legacy BusType           : PNPBus
    Class                    : USB
    Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
    Interface GUID           : {a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
    Enumerator               : USB
    Location Info            : Port_#0010.Hub_#0001
    Manufacturer Info        : (Standard USB Host Controller)
    Capabilities             : 0x64 (Removable, SilentInstall, RawDeviceOK)
    Status                   : 0x01806400 (DN_HAS_PROBLEM, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
    Problem Code             : 43 (CM_PROB_FAILED_POST_START)
    Address                  : 10
    Power State              : D3 (supported: D0, D3, wake from D0)
    
            ---------------- Connection Information ---------------
    Connection Index         : 0x0A (10)
    Connection Status        : 0x02 (DeviceFailedEnumeration)
    Current Config Value     : 0x00
    Device Address           : 0x00 (0)
    Is Hub                   : 0x00 (no)
    Number Of Open Pipes     : 0x00 (0)
    Device Bus Speed         : 0x02 (High-Speed)
    
            --------------- Connection Information V2 -------------
    Connection Index         : 0x0A (10)
    Length                   : 0x10 (16 bytes)
    SupportedUsbProtocols    : 0x03
     Usb110                  : 1 (yes)
     Usb200                  : 1 (yes)
     Usb300                  : 0 (no)
     ReservedMBZ             : 0x00
    Flags                    : 0x00
     DevIsOpAtSsOrHigher     : 0 (Is not operating at SuperSpeed or higher)
     DevIsSsCapOrHigher      : 0 (Is not SuperSpeed capable or higher)
     DevIsOpAtSsPlusOrHigher : 0 (Is not operating at SuperSpeedPlus or higher)
     DevIsSsPlusCapOrHigher  : 0 (Is not SuperSpeedPlus capable or higher)
     ReservedMBZ             : 0x00
    
        ---------------------- Device Descriptor ----------------------
    bLength                  : 0x00 (0 bytes)
    
          -------------------- String Descriptors -------------------
    String descriptors are not available  (because the device has problem code CM_PROB_FAILED_POST_START)

    so I am trying to isolate the parts of the kernel responsible for fulfilling this USB bootstrapping process to see if there are any clues there

    not quite sure what else I can try at present

    thanks

    - Richard

  • Hi Richard,

    It would be really helpful if you can connect it to a Linux machine, since we will be getting more logs. I am not sure about the Windows side. But one thing that appears strange is "VID_0000". Why is vendor ID 0x000 ? Can you check that ?
  • Thanks Dwarakesh 

    I'll put together a live boot USB so I can see what happens connected to a native linux system.

    The VID being 0000 was something I noticed in my original post; do you know where this is configured in the kernel?
    I have been trying to follow the startup process on my SDK but got sidetracked with the differences due to it using composite gadgets (and not g_ether)

    I'll see what more I can dig out.

    Thanks again

    Richard

  • Hi Richard,

    Probably disabling composite and trying to enable only g_ether, would be a worth try.

    Can you check if the idVendor in drivers/usb/gadget/composite.c file is proper ? Looks like it is coming from there.
  • Dwarakesh R said:

    Probably disabling composite and trying to enable only g_ether, would be a worth try.

    I believe that I only have g_ether enabled in this kernel

    • the "composite" driver is how the EVM SDK works: which is my only "successful" frame of reference

    Dwarakesh R said:

    Can you check if the idVendor in drivers/usb/gadget/composite.c file is proper ? Looks like it is coming from there.

    Thanks! I will try and insert some logging here to work out why the VID is empty; the macros for its definition appear to be included (here and in ether.c)

    Having connected the board to a PC live-booting in to Ubuntu I can see the following the in the logs of the host:

    [  781.025966] usb 1-10: new high-speed USB device number 11 using xhci_hcd
    [  781.138015] usb 1-10: Device not responding to setup address.
    [  781.342081] usb 1-10: Device not responding to setup address.
    [  781.545867] usb 1-10: device not accepting address 11, error -71
    [  781.657858] usb 1-10: new high-speed USB device number 12 using xhci_hcd
    [  781.770190] usb 1-10: Device not responding to setup address.
    [  781.974096] usb 1-10: Device not responding to setup address.
    [  782.177938] usb 1-10: device not accepting address 12, error -71
    [  782.289955] usb 1-10: new high-speed USB device number 13 using xhci_hcd
    [  782.290121] usb 1-10: Device not responding to setup address.
    [  782.494072] usb 1-10: Device not responding to setup address.
    [  782.697844] usb 1-10: device not accepting address 13, error -71
    [  782.810050] usb 1-10: new high-speed USB device number 14 using xhci_hcd
    [  782.810210] usb 1-10: Device not responding to setup address.
    [  783.014039] usb 1-10: Device not responding to setup address.
    [  783.217926] usb 1-10: device not accepting address 14, error -71
    [  783.217999] usb usb1-port10: unable to enumerate USB device

    Which at least gives an error code 

    • though it looks a bit generic "#define EPROTO 71 /* Protocol error */"
    • there is no entry reported if I "lsusb" after insertion so the fact of the VID reported is hidden

    Time to keep digging!

    All the best,

    Richard

  • From what I can presently tell within ether.c

    static struct usb_device_descriptor device_desc;

    is properly populated during the eth_bind function.

    but  the values that are entered in the  struct usb_composite_dev *cdev

     variable passed to the eth_bind function look bogus.

    These are obtained from "coverwrite" declared via a MACRO ( USB_GADGET_COMPOSITE_OPTIONS();)

    I have not yet been able to ascertain where the values being used are intialised.

    From my reading of the the comments it is as though these are expected to be passed at runtime when loading the driver?

    In which case there should be an equivalent, or defaults, to be used in the case of a statically included driver?

    The start up of g_ether with some debugging to compare the contents of device_desc and cdev

    [    1.580980] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [    1.591218] musb-hdrc: MHDRC RTL version 2.0 
    [    1.595422] musb-hdrc: setup fifo_mode 4
    [    1.599239] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [    1.613219] udc musb-hdrc.0.auto: registering UDC driver [g_ether]
    [    1.619397] using random self ethernet address
    [    1.623695] using random host ethernet address
    [    1.628879] usb0: HOST MAC 2a:02:8f:d5:78:6e
    [    1.633135] usb0: MAC a2:70:84:34:d0:8f
    [    1.636844] RM - drivers/usb/gadget/legacy/ether.c:eth_bind 375 ECM
    [    1.642961] using random self ethernet address
    [    1.647254] using random host ethernet address
    [    1.651571] RM - drivers/usb/gadget/legacy/ether.c:eth_bind 384 fi_rndis = cf408400 
    [    1.659073] RM - drivers/usb/gadget/legacy/ether.c:eth_bind 397 VID 0525 PID a4a2
    [    1.666296] g_ether gadget: adding config #2 'RNDIS'/c0940e9c
    [    1.671937] rndis_register: configNr = 0
    [    1.675725] g_ether gadget: adding 'rndis'/cf482b40 to config 'RNDIS'/c0940e9c
    [    1.682771] rndis_set_param_medium: 0 0
    [    1.686476] g_ether gadget: RNDIS: dual speed IN/ep1in OUT/ep1out NOTIFY/ep2in
    [    1.693491] g_ether gadget: cfg 2/c0940e9c speeds: high full
    [    1.698971] g_ether gadget:   interface 0 = rndis/cf482b40
    [    1.704263] g_ether gadget:   interface 1 = rndis/cf482b40
    [    1.709578] g_ether gadget: adding config #1 'CDC Ethernet (ECM)'/c0940df0
    [    1.716216] g_ether gadget: adding 'cdc_ethernet'/cf482c00 to config 'CDC Ethernet (ECM)'/c0940df0
    [    1.724898] g_ether gadget: CDC Ethernet: dual speed IN/ep1in OUT/ep1out NOTIFY/ep2in
    [    1.732471] g_ether gadget: cfg 1/c0940df0 speeds: high full
    [    1.737930] g_ether gadget:   interface 0 = cdc_ethernet/cf482c00
    [    1.743823] g_ether gadget:   interface 1 = cdc_ethernet/cf482c00
    [    1.749720] RM - drivers/usb/gadget/legacy/ether.c:eth_bind 430 cf49aa80 CDEV VID 0000 PID 0000 0 0
    [    1.758446] RM - drivers/usb/gadget/composite.c:usb_composite_overwrite_options 2293: CDEV cf49aa80 COVR c0991804 
    [    1.768442] RM - drivers/usb/gadget/composite.c:usb_composite_overwrite_options 2297: CDEV->vendor 0
    [    1.777265] RM - drivers/usb/gadget/composite.c:usb_composite_overwrite_options 2301: CDEV->product 0
    [    1.786299] RM - drivers/usb/gadget/composite.c:usb_composite_overwrite_options 2305: desc->bcdDevice 0
    [    1.795393] RM - drivers/usb/gadget/legacy/ether.c:eth_bind 437 cf49aa80 CDEV VID 0000 PID 0000 1 0
    [    1.804133] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
    [    1.810530] RM - drivers/usb/gadget/legacy/ether.c:eth_bind 447 VID 0525 PID a4a2 1 2
    [    1.818082] g_ether gadget: g_ether ready
    [    1.821972] g_ether musb-hdrc.0.auto: usb_gadget_udc_start
    

    Thanks for reading - I'll continue digging

    Richard

  • good going!

    Yes these could be provided at the time of insertion of the module or from user space through some proc/sysfs entry, may be.

    Can you try hardcoding these values in usb_composite_overwrite_options to check if it is making progress ?
  • Thanks

    yes I tried that - well immediately after returning from the overwrite function I inserted

    	cdev->desc.idVendor = device_desc.idVendor;
    	cdev->desc.idProduct = device_desc.idProduct;
    	cdev->desc.bcdDevice = device_desc.bcdDevice;

    as I had confirmed that the values in device_desc look believable 

    This has made no difference though - the info reported by the HOST is still nonsense

    Device ID                : USB\VID_0000&PID_0002

    I can confirm that the HW itself is fine as I get a serial port if I try an boot with no code

    Device ID                : USB\VID_0451&PID_6141

    Looks like I need to crawl lower in to the USB handling to see what's lurking there

    Thanks again,

    Richard

  • Richard,

    Richard McAleer said:

    I am using a board derived from the BeagleBoneBlack presently running ti-processor-sdk-linux-am335x-evm-03.02.00.05-Linux-x86-Install.bin (using the kernel linux-4.4.19+gitAUTOINC+db0b54cdad-gdb0b54cdad)

    Something is wrong here, the processor SDK v3.2 uses kernel v4.4.32, not v4.4.19. The kernel v4.4.19 is used in Processor SDK v3.1. But this is irrelevant to your problem, so let's continue, please follow the steps below.

    - Please boot your board with the prebuilt binaries that come with the Processor SDK v3.x you use;
    - on the uart console, run 'modprobe g_ether' and 'ifconfig usb0 <ipaddress>';
    - connect the board usb device port to your Windows host, the uart console should show a message as "g_ether gadget: high-speed config #2: RNDIS", and the Windows Network Adapter lists should show one as "Linux USB Ethernet/RNDIS Gadget..."; If not, likely you have a hw issue on your board USB design or layout;
    - If all works up to here, you only need to let the system to automatically load g_ether.ko at boot time and assign an ipaddress to it. These can be done in the filesystem, you don't have to change the kernel config.

    If you have to rebuild the kernel for your custom board, please use tisdk_am335x-evm_defconfig as the defconfig and don't change any USB related config options.

  • Hi Bin Liu

    thanks for the post.

    I will try as you suggest when I  next have my hands on the hardware: I am confident the USB traces work already as without any code running I can see a COM Port enumerating.

    One aspect I might not have been clear in is that I was trying to statically include this driver in the kernel: which is why I was following the instructions to do so in the TI Wiki

    Given you have a good understanding of this area I would be grateful if you could comment as to whether this is possible? (some of the documentation on this appears confusing and possibly out of date)

    Thanks for your help.

    Best regards,

    Richard

  • I have booted with the prebuilt binary for zImage and a freshly extracted rootfs as shipped.
    I have needed to provide a suitable dtb for our board (otherwise the boot will hang and watchdog)

    the start up serial is as follows: there are a few things I will note below this

    Kernel image @ 0x82000000 [ 0x000000 - 0x34a9d8 ]
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8ef19000, end 8ef25531 ... OK
    
    Starting kernel ...
    
    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Initializing cgroup subsys cpu
    [ 0.000000] Initializing cgroup subsys cpuacct
    [ 0.000000] Linux version 4.4.19-gdb0b54cdad (gtbldadm@ubuntu-16) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #1 PREEMPT Mon Oct 3 17:43:46 E6
    [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] Machine model: Compumedics Argo
    [ 0.000000] cma: Reserved 24 MiB at 0x8d000000
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] On node 0 totalpages: 65536
    [ 0.000000] free_area_init_node: node 0, pgdat c09546d4, node_mem_map cfdad000
    [ 0.000000] Normal zone: 576 pages used for memmap
    [ 0.000000] Normal zone: 0 pages reserved
    [ 0.000000] Normal zone: 65536 pages, LIFO batch:15
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM335X ES2.1 (neon )
    [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
    [ 0.000000] pcpu-alloc: [0] 0 
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 64960
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 loglevel=10 root=PARTUUID=1eb3b9b3-02 rw rootfstype=ext4 rootwait
    [ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [ 0.000000] Memory: 224976K/262144K available (6551K kernel code, 314K rwdata, 2396K rodata, 264K init, 265K bss, 12592K reserved, 24576K cma-reserved, )
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    [ 0.000000] vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
    [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
    [ 0.000000] .text : 0xc0008000 - 0xc08c5004 (8949 kB)
    [ 0.000000] .init : 0xc08c6000 - 0xc0908000 ( 264 kB)
    [ 0.000000] .data : 0xc0908000 - 0xc0956b10 ( 315 kB)
    [ 0.000000] .bss : 0xc0956b10 - 0xc0999258 ( 266 kB)
    [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [ 0.000000] Preemptible hierarchical RCU implementation.
    [ 0.000000] Build-time adjustment of leaf fanout to 32.
    [ 0.000000] NR_IRQS:16 nr_irqs:16 16
    [ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [ 0.000000] OMAP clockevent source: timer2 at 25000000 Hz
    [ 0.000016] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 85899345900ns
    [ 0.000045] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
    [ 0.000059] OMAP clocksource: timer1 at 25000000 Hz
    [ 0.000272] clocksource_probe: no matching clocksources found
    [ 0.000500] Console: colour dummy device 80x30
    [ 0.000531] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [ 0.000540] This ensures that you still see kernel messages. Please
    [ 0.000546] update your kernel commandline.
    [ 0.000570] Calibrating delay loop... 623.41 BogoMIPS (lpj=3117056)
    [ 0.048855] pid_max: default: 32768 minimum: 301
    [ 0.049014] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.049030] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.049900] Initializing cgroup subsys io
    [ 0.049945] Initializing cgroup subsys memory
    [ 0.049991] Initializing cgroup subsys devices
    [ 0.050011] Initializing cgroup subsys freezer
    [ 0.050030] Initializing cgroup subsys perf_event
    [ 0.050047] Initializing cgroup subsys pids
    [ 0.050084] CPU: Testing write buffer coherency: ok
    [ 0.050589] Setting up static identity map for 0x80008200 - 0x80008258
    [ 0.053341] devtmpfs: initialized
    [ 0.069084] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [ 0.087449] omap_hwmod: debugss: _wait_target_disable failed
    [ 0.144238] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [ 0.146955] pinctrl core: initialized pinctrl subsystem
    [ 0.148583] NET: Registered protocol family 16
    [ 0.151487] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [ 0.178848] cpuidle: using governor ladder
    [ 0.208837] cpuidle: using governor menu
    [ 0.214243] gpiochip_add: registered GPIOs 0 to 31 on device: gpio
    [ 0.214650] OMAP GPIO hardware version 0.1
    [ 0.215599] gpiochip_add: registered GPIOs 32 to 63 on device: gpio
    [ 0.216590] gpiochip_add: registered GPIOs 64 to 95 on device: gpio
    [ 0.217553] gpiochip_add: registered GPIOs 96 to 127 on device: gpio
    [ 0.228056] hw-breakpoint: debug architecture 0x4 unsupported.
    [ 0.269707] edma 49000000.edma: TI EDMA DMA engine driver
    [ 0.270185] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulator@0[0]'
    [ 0.270647] of_get_named_gpiod_flags: parsed 'gpio' property of node '/fixedregulator@2[0]' - status (0)
    [ 0.274786] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
    [ 0.274964] media: Linux media interface: v0.10
    [ 0.275039] Linux video capture interface: v2.00
    [ 0.275109] pps_core: LinuxPPS API ver. 1 registered
    [ 0.275119] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.275156] PTP clock support registered
    [ 0.275222] EDAC MC: Ver: 3.0.0
    [ 0.276699] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
    [ 0.277105] Advanced Linux Sound Architecture Driver Initialized.
    [ 0.278654] clocksource: Switched to clocksource timer1
    [ 0.292728] NET: Registered protocol family 2
    [ 0.293741] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.293790] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.293826] TCP: Hash tables configured (established 2048 bind 2048)
    [ 0.293919] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.293944] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.294139] NET: Registered protocol family 1
    [ 0.294645] RPC: Registered named UNIX socket transport module.
    [ 0.294666] RPC: Registered udp transport module.
    [ 0.294674] RPC: Registered tcp transport module.
    [ 0.294683] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 0.294715] PCI: CLS 0 bytes, default 64
    [ 0.295905] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [ 0.298427] futex hash table entries: 256 (order: -1, 3072 bytes)
    [ 0.309264] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [ 0.310430] NFS: Registering the id_resolver key type
    [ 0.310512] Key type id_resolver registered
    [ 0.310524] Key type id_legacy registered
    [ 0.310623] ntfs: driver 2.1.32 [Flags: R/O].
    [ 0.315217] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
    [ 0.315259] io scheduler noop registered
    [ 0.315279] io scheduler deadline registered
    [ 0.315487] io scheduler cfq registered (default)
    [ 0.317250] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [ 0.398507] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    [ 0.403997] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
    [ 1.052924] console [ttyS0] enabled
    [ 1.057924] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 159, base_baud = 3000000) is a 8250
    [ 1.067959] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 160, base_baud = 3000000) is a 8250
    [ 1.077845] [drm] Initialized drm 1.1.0 20060810
    [ 1.083834] panel panel: GPIO lookup for consumer enable
    [ 1.089066] panel panel: using device tree for GPIO lookup
    [ 1.094369] of_get_named_gpiod_flags: can't parse 'enable-gpios' property of node '/panel[0]'
    [ 1.102619] of_get_named_gpiod_flags: can't parse 'enable-gpio' property of node '/panel[0]'
    [ 1.110777] panel panel: using lookup tables for GPIO lookup
    [ 1.116241] panel panel: lookup for GPIO enable failed
    [ 1.130016] loop: module loaded
    [ 1.138915] libphy: Fixed MDIO Bus: probed
    [ 1.208743] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [ 1.214648] davinci_mdio 4a101000.mdio: no live phy, scanning all
    [ 1.220885] davinci_mdio: probe of 4a101000.mdio failed with error -5
    [ 1.241730] cpsw 4a100000.ethernet: Detected MACID = 98:5d:ad:4e:d2:5e
    [ 1.264064] mousedev: PS/2 mouse device common for all mice
    [ 1.270457] i2c /dev entries driver
    [ 1.275145] cpuidle: enable-method property 'ti,am3352' found operations
    [ 1.282795] omap_hsmmc 48060000.mmc: GPIO lookup for consumer cd
    [ 1.288606] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
    [ 1.295052] of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/ocp/mmc@48060000[0]' - status (0)
    [ 1.304642] omap_hsmmc 48060000.mmc: Got CD GPIO
    [ 1.309129] omap_hsmmc 48060000.mmc: GPIO lookup for consumer wp
    [ 1.314924] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
    [ 1.321243] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@48060000[0]'
    [ 1.330071] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@48060000[0]'
    [ 1.338812] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
    [ 1.345279] omap_hsmmc 48060000.mmc: lookup for GPIO wp failed
    [ 1.389527] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer cd
    [ 1.396412] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
    [ 1.404801] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@481d8000[0]'
    [ 1.413664] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@481d8000[0]'
    [ 1.422462] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
    [ 1.428997] omap_hsmmc 481d8000.mmc: lookup for GPIO cd failed
    [ 1.434681] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer wp
    [ 1.440551] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
    [ 1.446876] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@481d8000[0]'
    [ 1.456736] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@481d8000[0]'
    [ 1.467506] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
    [ 1.474015] omap_hsmmc 481d8000.mmc: lookup for GPIO wp failed
    [ 1.506123] mmc0: host does not support reading read-only switch, assuming write-enable
    [ 1.515916] mmc0: new high speed SDHC card at address 59b4
    [ 1.522064] mmcblk0: mmc0:59b4 1.84 GiB 
    [ 1.528261] mmcblk0: p1 p2
    [ 1.599521] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led@2[0]' - status (0)
    [ 1.608570] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led@3[0]' - status (0)
    [ 1.638884] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led@4[0]' - status (0)
    [ 1.647794] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led@5[0]' - status (0)
    [ 1.679292] ledtrig-cpu: registered to indicate activity on CPUs
    [ 1.688373] NET: Registered protocol family 10
    [ 1.709594] sit: IPv6 over IPv4 tunneling driver
    [ 1.715105] NET: Registered protocol family 17
    [ 1.729087] Key type dns_resolver registered
    [ 1.733452] omap_voltage_late_init: Voltage driver support not added
    [ 1.786409] tps65217 0-0024: TPS65217 ID 0xe version 1.2
    [ 1.799005] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
    [ 1.805685] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [ 1.829958] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 625000 KHz
    [ 1.837067] cpu cpu0: dev_pm_opp_domain_set_rate: failed to find current OPP for freq 625000000 (-34)
    [ 1.870129] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 600000 KHz
    [ 1.879440] hctosys: unable to open rtc device (rtc0)
    [ 1.899221] ALSA device list:
    [ 1.902119] No soundcards found.
    [ 2.840634] EXT4-fs (mmcblk0p2): recovery complete
    [ 2.925140] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [ 2.933084] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [ 2.942502] devtmpfs: mounted
    [ 2.945850] Freeing unused kernel memory: 264K (c08c6000 - c0908000)
    [ 2.952273] This architecture does not have kernel memory protection.
    [ 3.245507] systemd[1]: System time before build time, advancing clock.
    [ 3.328421] random: systemd: uninitialized urandom read (16 bytes read, 21 bits of entropy available)
    [ 3.347944] random: systemd: uninitialized urandom read (16 bytes read, 21 bits of entropy available)
    [ 3.384952] systemd[1]: systemd 229 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +)
    [ 3.405431] systemd[1]: Detected architecture arm.
    
    Welcome to Arago 2016.08!
    
    [ 3.430478] systemd[1]: Set hostname to <am335x-evm>.
    [ 3.531530] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 25 bits of entropy available)
    [ 3.574933] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 25 bits of entropy available)
    [ 3.586174] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 25 bits of entropy available)
    [ 3.605082] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 26 bits of entropy available)
    [ 3.630547] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 27 bits of entropy available)
    [ 3.741792] random: systemd: uninitialized urandom read (16 bytes read, 31 bits of entropy available)
    [ 3.751785] random: systemd: uninitialized urandom read (16 bytes read, 31 bits of entropy available)
    [ 3.762913] random: systemd: uninitialized urandom read (16 bytes read, 31 bits of entropy available)
    [ 3.990540] systemd[1]: [/lib/systemd/system/gadget-init.service:15] Unknown lvalue 'ExecStopPre' in section 'Service'
    [ 4.323509] systemd[1]: basic.target: Found ordering cycle on basic.target/start
    [ 4.330908] systemd[1]: basic.target: Found dependency on sysinit.target/start
    [ 4.337914] systemd[1]: basic.target: Found dependency on alignment.service/start
    [ 4.345295] systemd[1]: basic.target: Found dependency on basic.target/start
    [ 4.352150] systemd[1]: basic.target: Breaking ordering cycle by deleting job alignment.service/start
    [ 4.361091] systemd[1]: alignment.service: Job alignment.service/start deleted to break ordering cycle starting with basic.target/start
    [ SKIP ] Ordering cycle found, skipping alignment.service
    [ 4.406623] systemd[1]: Listening on udev Kernel Socket.
    [ OK ] Listening on udev Kernel Socket.
    [ 4.432590] systemd[1]: Created slice User and Session Slice.
    [ OK ] Created slice User and Session Slice.
    [ 4.459205] systemd[1]: Reached target Remote File Systems.
    [ OK ] Reached target Remote File Systems.
    [ 4.508320] systemd[1]: Listening on Network Service Netlink Socket.
    [ OK ] Listening on Network Service Netlink Socket.
    [ 4.539756] systemd[1]: Listening on Journal Socket.
    [ OK ] Listening on Journal Socket.
    [ 4.569645] systemd[1]: Listening on udev Control Socket.
    [ OK ] Listening on udev Control Socket.
    [ 4.601940] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
    [ OK ] Listening on /dev/initctl Compatibility Named Pipe.
    [ 4.630371] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
    [ OK ] Started Forward Password Requests to Wall Directory Watch.
    [ 4.660180] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
    [ OK ] Started Dispatch Password Requests to Console Directory Watch.
    [ 4.689421] systemd[1]: Reached target Paths.
    [ OK ] Reached target Paths.
    [ 4.719871] systemd[1]: Listening on Journal Socket (/dev/log).
    [ OK ] Listening on Journal Socket (/dev/log).
    [ 4.749426] systemd[1]: Reached target Swap.
    [ OK ] Reached target Swap.
    [ 4.782215] systemd[1]: Created slice System Slice.
    [ OK ] Created slice System Slice.
    [ 4.809639] systemd[1]: Reached target Slices.
    [ OK ] Reached target Slices.
    [ 4.851230] systemd[1]: Mounting Temporary Directory...
    Mounting Temporary Directory...
    [ 4.915465] systemd[1]: Starting Setup Virtual Console...
    Starting Setup Virtual Console...
    [ 5.031145] systemd[1]: Starting Load Kernel Modules...
    Starting Load Kernel Modules...
    [ 5.118064] systemd[1]: Starting Remount Root and Kernel File Systems...
    Starting Remount Root and Kernel File Systems...
    [ 5.179926] cryptodev: driver 1.8 loaded.
    [ 5.214899] systemd[1]: Mounting Debug File System...
    Mounting Debug File System...
    [ 5.271415] systemd[1]: Created slice system-serial\x2dgetty.slice.
    [ 5.310268] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
    [ OK ] Created slice system-serial\x2dgetty.slice.
    [ 5.341320] systemd[1]: Created slice system-getty.slice.
    [ OK ] Created slice system-getty.slice.
    [ 5.375447] systemd[1]: Starting Create list of required static device nodes for the current kernel...
    Starting Create list of required st... nodes for the current kernel...
    [ 5.435568] systemd[1]: Mounting POSIX Message Queue File System...
    Mounting POSIX Message Queue File System...
    [ 5.479720] systemd[1]: Listening on Syslog Socket.
    [ OK ] Listening on Syslog Socket.
    [ 5.514983] systemd[1]: Starting Journal Service...
    Starting Journal Service...
    [ 5.623418] systemd[1]: Mounted POSIX Message Queue File System.
    [ OK ] Mounted POSIX Message Queue File System.
    [ 5.669667] systemd[1]: Mounted Debug File System.
    [ OK ] Mounted Debug File System.
    [ 5.689600] systemd[1]: Mounted Temporary Directory.
    [ OK ] Mounted Temporary Directory.
    [ 5.720267] systemd[1]: Started Journal Service.
    [ OK ] Started Journal Service.
    [ OK ] Started Setup Virtual Console.
    [ OK ] Started Load Kernel Modules.
    [ OK ] Started Remount Root and Kernel File Systems.
    [ OK ] Started Create list of required sta...ce nodes for the current kernel.
    Starting Create Static Device Nodes in /dev...
    Starting udev Coldplug all Devices...
    Starting Apply Kernel Variables...
    Starting Flush Journal to Persistent Storage...
    [ OK ] Started Create Static Device Nodes in /dev.
    [ OK ] Started Apply Kernel Variables.
    [ 7.791152] systemd-journald[99]: Received request to flush runtime journal from PID 1
    [ OK ] Started Flush Journal to Persistent Storage.
    Starting udev Kernel Device Manager...
    [ OK ] Reached target Local File Systems (Pre).
    Mounting /var/volatile...
    Mounting /media/ram...
    [ OK ] Mounted /var/volatile.
    [ OK ] Mounted /media/ram.
    [ OK ] Started udev Coldplug all Devices.
    [ OK ] Started udev Kernel Device Manager.
    [ 9.830499] am335x-phy-driver 47401300.usb-phy: GPIO lookup for consumer reset
    [ 9.837510] am335x-phy-driver 47401300.usb-phy: using device tree for GPIO lookup
    [ 9.999019] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [ 10.144221] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [ OK ] Found device /dev/ttyS0.
    [ 10.278941] am335x-phy-driver 47401300.usb-phy: using lookup tables for GPIO lookup
    [ 10.286374] am335x-phy-driver 47401300.usb-phy: lookup for GPIO reset failed
    Starting Load/Save Random Seed...
    [ OK ] Reached target Local File Systems.
    [ 10.458221] am335x-phy-driver 47401300.usb-phy: GPIO lookup for consumer vbus-detect
    Starting Create Volatile Files and Directories...
    [ 10.567689] am335x-phy-driver 47401300.usb-phy: using device tree for GPIO lookup
    [ 10.688892] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpios' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [ OK ] Started Load/Save Random Seed.
    [ 10.769089] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpio' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [ 10.862215] am335x-phy-driver 47401300.usb-phy: using lookup tables for GPIO lookup
    [ 10.938841] am335x-phy-driver 47401300.usb-phy: lookup for GPIO vbus-detect failed
    [ 10.946289] 47401300.usb-phy supply vcc not found, using dummy regulator
    [ 11.182182] rtc rtc0: 44e3e000.rtc: dev (254:0)
    [ OK ] Started Create Volatile Files and Directories.
    [ 11.228952] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
    [ 11.314078] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [ 11.393734] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
    [ 11.447615] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
    [ 11.704557] remoteproc0: wkup_m3 is available
    [ 11.767913] remoteproc0: Note: remoteproc is still under development and considered experimental.
    [ 11.865148] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [ 12.081340] remoteproc0: powering up wkup_m3
    [ 12.086994] remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
    [ 12.213811] remoteproc0: remote processor wkup_m3 is now up
    [ 12.213849] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x191
    [ 12.283438] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
    [ OK ] Found device /dev/ttyS3.
    [ 12.744519] omap_hwmod: pruss: _wait_target_ready failed: -16
    [ 12.818976] ti-pruss 4a300000.pruss: couldn't enable pruss
    [ 12.824431] ti-pruss: probe of 4a300000.pruss failed with error -16
    [ 12.974849] omap_hwmod: gfx: failed to hardreset
    [ 13.140043] pvrsrvkm 56000000.sgx: Unable to reset SGX!
    [ 13.266317] omap_hwmod: gfx: _wait_target_ready failed: -16
    [ 13.398910] PVR_K:(Error): EnableSGXClocks: pm_runtime_get_sync failed (16)
    [ 13.405674] PVR_K:(Error): SysInitialise: Failed to Enable system clocks (175)
    Starting Network Time Synchronization...
    [ 13.560970] PM: bootloader does not support rtc-only!
    Starting Update UTMP about System Boot/Shutdown...
    [ 14.341828] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
    [ OK ] Started Network Time Synchronization.
    [ OK ] Started Update UTMP about System Boot/Shutdown.
    [ OK ] Found device /dev/mmcblk0p1.
    [ OK ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
    Starting Synchronize System and HW clocks...
    [ OK ] Reached target System Time Synchronized.
    [ OK ] Started Synchronize System and HW clocks.
    [ 17.376510] usbcore: registered new interface driver usbfs
    [ 17.480582] usbcore: registered new interface driver hub
    [ 17.517937] usbcore: registered new device driver usb
    [ 17.663459] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [ 17.739189] musb-hdrc: MHDRC RTL version 2.0 
    [ 17.743434] musb-hdrc: setup fifo_mode 4
    [ 17.747239] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [ 17.799453] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver
    [ 17.805074] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1
    [ 17.833574] hub 1-0:1.0: USB hub found
    [ 17.837299] hub 1-0:1.0: 1 port detected
    [ OK ] Reached target System Initialization.
    [ OK ] Listening on dropbear.socket.
    [ OK ] Listening on RPCbind Server Activation Socket.
    [ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
    [ OK ] Started Daily Cleanup of Temporary Directories.
    [ OK ] Reached target Timers.
    [ OK ] Listening on D-Bus System Message Bus Socket.
    [ OK ] Reached target Sockets.
    [ OK ] Reached target Basic System.
    Starting Start USB gadget...
    [ OK ] Started System Logging Service.
    Starting Avahi mDNS/DNS-SD Stack...
    Starting Print notice about GPLv3 packages...
    Starting Telephony service...
    [ OK ] Started D-Bus System Message Bus.
    [ 19.546409] using random self ethernet address
    [ 19.561082] using random host ethernet address
    [ 19.586387] using host ethernet address: 98:5D:AD:4E:D2:60
    [ 19.599998] using random self ethernet address
    [ 19.615154] using random host ethernet address
    [ 19.638855] using host ethernet address: 98:5D:AD:4E:D2:60
    [ 19.663869] usb0: HOST MAC 98:5d:ad:4e:d2:60
    [ 19.692215] usb0: MAC 22:be:e7:08:0f:d0
    [ 19.791237] Mass Storage Function, version: 2009/09/11
    [ 19.796238] LUN: removable file: (no medium)
    [ 19.860525] random: nonblocking pool is initialized
    [ OK ] Started Telephony service.
    [ 19.901265] LUN: removable read only file: /dev/mmcblk0p1
    [ OK ] Started Avahi mDNS/DNS-SD Stack.
    Starting Network Service...
    [ 19.947811] Number of LUNs=1
    [ OK ] Started Kernel Logging Service.
    [ 19.990067] g_multi gadget: Multifunction Composite Gadget
    [ 20.038472] g_multi gadget: g_multi ready
    [ 20.070716] Bluetooth: Core ver 2.21
    Starting Permit User Sessions...
    [ 20.134255] NET: Registered protocol family 31
    [ 20.138586] Bluetooth: HCI device and connection manager initialized
    Starting Login Service...
    [ OK ] Started strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf.
    [ 20.275362] Bluetooth: HCI socket layer initialized
    [ 20.307416] Bluetooth: L2CAP socket layer initialized
    Starting uim-sysfs.service...
    [ 20.397334] Bluetooth: SCO socket layer initialized
    [ OK ] Started Permit User Sessions.
    [ OK ] Started Network Service.
    [ 20.724894] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
    [ 21.000877] net eth0: initializing cpsw version 1.12 (0)
    [ 21.006066] net eth0: initialized cpsw ale version 1.4
    [ 21.049579] net eth0: ALE Table size 1024
    [ 21.089664] libphy: PHY 4a101000.mdio:00 not found
    [ 21.094336] net eth0: phy "4a101000.mdio:00" not found on slave 0, err -19
    [ OK ] Found device /dev/ttyGS0.
    [ 21.198938] libphy: PHY 4a101000.mdio:01 not found
    [ 21.227760] net eth0: phy "4a101000.mdio:01" not found on slave 1, err -19
    [ 21.333127] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [ 21.535054] NET: Registered protocol family 15
    [ OK ] Started Start USB gadget.
    [ 22.479325] Initializing XFRM netlink socket
    Mounting Configuration File System...
    [ OK ] Reached target Network.
    Starting Lightning Fast Webserver With Light System Requirements...
    Starting Network Name Resolution...
    [ OK ] Started Getty on tty1.
    [ OK ] Started Serial Getty on ttyS0.
    [ OK ] Started Serial Getty on ttyS3.
    [ OK ] Started Serial Getty on ttyGS0.
    [ OK ] Mounted Configuration File System.
    [ OK ] Started Network Name Resolution.
    [ OK ] Started Lightning Fast Webserver With Light System Requirements.
    [ OK ] Started Login Service.
    [ OK ] Started uim-sysfs.service.
    Starting rc.pvr.service...
    ***************************************************************
    ***************************************************************
    NOTICE: This file system contains the following GPLv3 packages:
    autoconf
    binutils
    bison-dev
    bison
    cpp-symlinks
    cpp
    dosfstools
    g++-symlinks
    g++
    gawk-dev
    gawk
    gcc-symlinks
    gcc
    gdb
    gdbserver
    gstreamer1.0-libav
    hidapi
    libcairo-perf-utils
    libgmp10
    libidn11
    libmpc3
    libmpfr4
    make
    nettle
    swig-dev
    swig
    
    If you do not wish to distribute GPLv3 components please remove
    the above packages prior to distribution. This can be done using
    the opkg remove command. i.e.:
    opkg remove <package>
    Where <package> is the name printed in the list above
    
    NOTE: If the package is a dependency of another package you
    will be notified of the dependent packages. You should
    use the --force-removal-of-dependent-packages option to
    also remove the dependent packages as well
    ***************************************************************
    ***************************************************************
    [ OK ] Started Print notice about GPLv3 packages.
    [ OK ] Started rc.pvr.service.
    Starting weston.service...
    [ OK ] Started weston.service.
    Starting telnetd.service...
    [ OK ] Started telnetd.service.
    Starting thttpd.service...
    Starting busybox-udhcpd.service...
    [ OK ] Started thttpd.service.
    [ OK ] Started busybox-udhcpd.service.
    Starting rng-tools.service...
    [ OK ] Started rng-tools.service.
    Starting matrix-gui-2.0.service...
    [ OK ] Started matrix-gui-2.0.service.
    Starting parse-ip.service...
    Starting thermal-zone-init.service...
    
    _____ _____ _ _ 
    | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_ 
    | | _| .'| . | . | | __| _| . | | | -_| _| _|
    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_| 
    |___| |___|
    
    Arago Project http://arago-project.org am335x-evm ttyS0
    
    Arago 2016.08 am335x-evm ttyS0
    
    am335x-evm login: root
    root@am335x-evm:~# lsmod
    Module Size Used by
    sha512_generic 9903 0
    sha512_arm 12079 0
    drbg 13425 1
    des_generic 17736 0
    cbc 2324 0
    xfrm_user 22606 2
    xfrm4_tunnel 2040 0
    ipcomp 2257 0
    xfrm_ipcomp 4311 1 ipcomp
    esp4 6466 0
    ah4 5627 0
    af_key 26406 0
    xfrm_algo 6970 5 ah4,esp4,af_key,xfrm_user,xfrm_ipcomp
    bluetooth 327425 2
    usb_f_acm 5404 1
    u_serial 11555 3 usb_f_acm
    usb_f_ecm 6620 1
    g_multi 6330 0
    usb_f_mass_storage 37916 2 g_multi
    usb_f_rndis 15406 2 g_multi
    u_ether 13577 3 usb_f_ecm,usb_f_rndis,g_multi
    libcomposite 44392 5 usb_f_acm,usb_f_ecm,usb_f_rndis,g_multi,usb_f_mass_storage
    configfs 26917 6 usb_f_acm,usb_f_ecm,usb_f_rndis,libcomposite,usb_f_mass_storage
    musb_dsps 8235 0
    musb_hdrc 71550 1 musb_dsps
    udc_core 12063 2 musb_hdrc,libcomposite
    usbcore 195125 1 musb_hdrc
    pm33xx 5577 0
    pru_rproc 11582 0
    pruss_intc 7163 1 pru_rproc
    ecb 1909 0
    ti_emif_sram 6242 1 pm33xx
    sha256_generic 9503 1
    wkup_m3_ipc 7715 1 pm33xx
    hmac 2735 1
    md5 1897 0
    wkup_m3_rproc 3669 1
    sha1_generic 2621 0
    sha1_arm_neon 6261 0
    sha1_arm 3862 1 sha1_arm_neon
    pvrsrvkm 406903 0
    pruss 10892 1 pru_rproc
    omap_aes_driver 19430 0
    omap_sham 21513 0
    remoteproc 26901 4 pruss,wkup_m3_rproc,pru_rproc,wkup_m3_ipc
    virtio 7742 1 remoteproc
    virtio_ring 12035 1 remoteproc
    omap_rng 4482 0
    rng_core 7794 1 omap_rng
    rtc_omap 8272 1
    musb_am335x 1426 0
    omap_wdt 4634 0
    sch_fq_codel 8289 3
    cryptodev 38007 1
    root@am335x-evm:~# modprobe g_ether
    modprobe: ERROR: could not insert 'g_ether': No such device
    
    

    As per the last line in that pasting I am unable to start g_ether being told there is: No Such device

    I can see the module 

    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/usb/gadget/legacy# ls g_ether.ko -l
    
    -rw-r--r-- 1 1000 pulse 12376 Oct 3 2016 g_ether.ko
    

    - so perhaps it is a dependency that is missing?

    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/usb/gadget/legacy# modprobe --show-depends g_ether 
    insmod /lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/usb/gadget/udc/udc-core.ko 
    insmod /lib/modules/4.4.19-gdb0b54cdad/kernel/fs/configfs/configfs.ko 
    insmod /lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/usb/gadget/libcomposite.ko 
    insmod /lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/usb/gadget/function/u_ether.ko 
    insmod /lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/usb/gadget/function/usb_f_rndis.ko 
    insmod /lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/usb/gadget/legacy/g_ether.ko

    - but those files are present

    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel# find . -name udc-core.ko
    ./drivers/usb/gadget/udc/udc-core.ko
    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel# find . -name configfs.ko
    ./fs/configfs/configfs.ko
    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel# find . -name libcomposite.ko                                                                        
    ./drivers/usb/gadget/libcomposite.ko
    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel# find . -name u_ether.ko                                                                             
    ./drivers/usb/gadget/function/u_ether.ko
    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel# find . -name usb_f_rndis.ko                                                                         
    ./drivers/usb/gadget/function/usb_f_rndis.ko
    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel# find . -name g_ether.ko                                                                             
    ./drivers/usb/gadget/legacy/g_ether.ko
    

    if I try and remove g_multi (so that I can load g_ehter) the system hangs

    root@am335x-evm:/lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/usb/gadget/legacy# modprobe -r g_multi
    ^C

    - it is not reponsive to any input and I need to reboot


    If I try and connect via USB with the g_multi gadget running I see the same malfunctioning USB device I had previously

    ======================== USB Device ========================
    
    +++++++++++++++++ Device Information ++++++++++++++++++
    Device Description : Unknown USB Device (Set Address Failed)
    Device Path : \\.\usb#vid_0000&pid_0004#5&33eb7b70&0&10#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
    Device ID : USB\VID_0000&PID_0004\5&33EB7B70&0&10
    Hardware IDs : USB\SET_ADDRESS_FAILURE
    Driver KeyName : {36fc9e60-c465-11cf-8056-444553540000}\0019 (GUID_DEVCLASS_USB)
    Driver Inf : C:\WINDOWS\inf\usb.inf
    Legacy BusType : PNPBus
    Class : USB
    Class GUID : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
    Interface GUID : {a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
    Enumerator : USB
    Location Info : Port_#0010.Hub_#0001
    Manufacturer Info : (Standard USB Host Controller)
    Capabilities : 0x64 (Removable, SilentInstall, RawDeviceOK)
    Status : 0x01806400 (DN_HAS_PROBLEM, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
    Problem Code : 43 (CM_PROB_FAILED_POST_START)
    Address : 10
    Power State : D3 (supported: D0, D3, wake from D0)

    I have been able to attach using the EVM_SDK running this gadget (so hopefully this is narrowing down the possible locations where any issue might lie)

    If I power up the board without any code I can see a valid USB serial COM port

    +++++++++++++++++ Device Information ++++++++++++++++++
    Friendly Name : USB Serial Device (COM3)
    Device Description : USB Serial Device
    Device Path : \\.\usb#vid_0451&pid_6141#5&33eb7b70&0&10#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
    Device ID : USB\VID_0451&PID_6141\5&33EB7B70&0&10
    Hardware IDs : USB\VID_0451&PID_6141&REV_0000 USB\VID_0451&PID_6141
    Driver KeyName : {4d36e978-e325-11ce-bfc1-08002be10318}\0003 (GUID_DEVCLASS_PORTS)
    Driver : \SystemRoot\System32\drivers\usbser.sys (Version: Date: )
    Driver Inf : C:\WINDOWS\inf\usbser.inf
    Legacy BusType : PNPBus
    Class : Ports
    Class GUID : {4d36e978-e325-11ce-bfc1-08002be10318} (GUID_DEVCLASS_PORTS)
    Interface GUID : {a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
    Service : usbser
    Enumerator : USB
    Location Info : Port_#0010.Hub_#0001
    Location IDs : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(10), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS10)
    Container ID : {f0d46518-4b15-11e7-b797-e84e062a3081}
    Manufacturer Info : Microsoft
    Capabilities : 0x84 (Removable, SurpriseRemovalOK)
    Status : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
    Problem Code : 0
    Power State : D0 (supported: D0, D3, wake from D0)
    COM-Port : COM3 (\Device\USBSER000)

    so while there might be something wrong with the hardware it does not appear to be fundamental if it can bring up this device using the code in the chip ROM

    looking at the usb/devices in a debugfs

    root@am335x-evm:/proc/sys/debug/usb# cat devices 
    
    T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
    B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
    D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=1d6b ProdID=0002 Rev= 4.04
    S:  Manufacturer=Linux 4.4.19-gdb0b54cdad musb-hcd
    S:  Product=MUSB HDRC host driver
    S:  SerialNumber=musb-hdrc.0.auto
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms
    root@am335x-evm:/proc/sys/debug/usb# 
    

    which is that same as the entry for musb-hdrc.0 that I can see on my working EVM_SDK

    However I can see differences in the regdump  of musb-hdrc.0 (though I am unsure what these mean)

    cat musb-hdrc.0.auto/regdump 
    EVM SDK Custom Board
           

    MUSB (M)HDRC Register Dump
    FAddr : 00
    Power : 20
    Frame : 0000
    Index : 0f
    Testmode : 00
    TxMaxPp : 2000
    TxCSRp : 0000
    RxMaxPp : 0000
    RxCSR : 0000
    RxCount : 0000
    IntrRxE : 0000
    IntrTxE : 0000
    IntrUsbE : 00
    DevCtl : 98
    VControl : 00000000
    HWVers : 0000
    LinkInfo : 5c
    VPLen : 3c
    HS_EOF1 : 80
    FS_EOF1 : 77
    LS_EOF1 : 72
    SOFT_RST : 00
    DMA_CNTLch0 : 0000
    DMA_ADDRch0 : 00000000
    DMA_COUNTch0: 00000000
    DMA_CNTLch1 : 0000
    DMA_ADDRch1 : 00000000
    DMA_COUNTch1: 00000000
    DMA_CNTLch2 : 0000
    DMA_ADDRch2 : 00000000
    DMA_COUNTch2: 00000000
    DMA_CNTLch3 : 0000
    DMA_ADDRch3 : 00000000
    DMA_COUNTch3: 00000000
    DMA_CNTLch4 : 0000
    DMA_ADDRch4 : 00000000
    DMA_COUNTch4: 00000000
    DMA_CNTLch5 : 0000
    DMA_ADDRch5 : 00000000
    DMA_COUNTch5: 00000000
    DMA_CNTLch6 : 0000
    DMA_ADDRch6 : 00000000
    DMA_COUNTch6: 00000000
    DMA_CNTLch7 : 0000
    DMA_ADDRch7 : 00000000
    DMA_COUNTch7: 00000000
    ConfigData : 00
    BabbleCtl : 44
    TxFIFOsz : 07
    RxFIFOsz : 07
    TxFIFOadd : 0780
    RxFIFOadd : 0780
    EPInfo : ff
    RAMInfo : 0d

                  
       

    MUSB (M)HDRC Register Dump
    FAddr : 00
    Power : f0
    Frame : 0336
    Index : 00
    Testmode : 00
    TxMaxPp : f000
    TxCSRp : 0000
    RxMaxPp : 0000
    RxCSR : ffff
    RxCount : fffe
    IntrRxE : fffe
    IntrTxE : ffff
    IntrUsbE : f7
    DevCtl : 99
    VControl : 00000000
    HWVers : 0000
    LinkInfo : 5c
    VPLen : 3c
    HS_EOF1 : 80
    FS_EOF1 : 77
    LS_EOF1 : 72
    SOFT_RST : 00
    DMA_CNTLch0 : 0000
    DMA_ADDRch0 : 00000000
    DMA_COUNTch0: 00000000
    DMA_CNTLch1 : 0000
    DMA_ADDRch1 : 00000000
    DMA_COUNTch1: 00000000
    DMA_CNTLch2 : 0000
    DMA_ADDRch2 : 00000000
    DMA_COUNTch2: 00000000
    DMA_CNTLch3 : 0000
    DMA_ADDRch3 : 00000000
    DMA_COUNTch3: 00000000
    DMA_CNTLch4 : 0000
    DMA_ADDRch4 : 00000000
    DMA_COUNTch4: 00000000
    DMA_CNTLch5 : 0000
    DMA_ADDRch5 : 00000000
    DMA_COUNTch5: 00000000
    DMA_CNTLch6 : 0000
    DMA_ADDRch6 : 00000000
    DMA_COUNTch6: 00000000
    DMA_CNTLch7 : 0000
    DMA_ADDRch7 : 00000000
    DMA_COUNTch7: 00000000
    ConfigData : 00
    BabbleCtl : 44
    TxFIFOsz : 00
    RxFIFOsz : 00
    TxFIFOadd : 0000
    RxFIFOadd : 0000
    EPInfo : ff
    RAMInfo : 0d

      

    I'll keep digging along these lines to establish where there are differences between the two systems.

    Any further suggestions would be gratefully appreciated.

    All the best,

    Richard

  • Richard,

    You are unable to load g_ether that is because g_multi is already loaded. I am not sure why unloading g_multi hangs the system, I haven't used g_multi for a very long time. But to prevent Linux to automatically load g_multi, you could remove /lib/systemd/system/gadget-init.service.

    The wiki page you referred is still applicable to current Processor SDK. I have updated the page to reflect that. So the known issue for building in usb gadget still exists, but you have a workaround - disable CPPI41 DMA to use PIO mode. Note this workaround has usb throughput impact, so any specific reason you want to build the usb drivers into the kernel?

  • Thanks

    I have removed the gadget service as suggested and can now try to launch g_ether.

    root@am335x-evm:~# modprobe g_ether
    [ 49.238444] using random self ethernet address
    [ 49.259286] using random host ethernet address
    [ 49.325913] usb0: HOST MAC de:f8:73:8a:7a:d0
    [ 49.343747] usb0: MAC ce:91:ef:50:d0:a4
    [ 49.379043] using random self ethernet address
    [ 49.411359] using random host ethernet address
    [ 49.415863] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
    [ 49.489212] g_ether gadget: g_ether ready
    root@am335x-evm:~# [ 49.604101] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready

    The results however are the same - in that it does not enumerate properly for my PC

    I have spoken to the HW designer that laid out the board.
    The USB side of things has been based on the Beagle Bone Black implementation of USB0 ( we are not using USB1 at all)
    The schematics are identical.

    The DTS settings to support this are:

    &usb {
    status = "okay";
    };
    
    &usb_ctrl_mod {
    status = "okay";
    };
    
    &usb0_phy {
    status = "okay";
    };
    
    &usb1_phy {
    status = "disabled";
    };
    
    &usb0 {
    status = "okay";
    dr_mode = "peripheral";
    };
    
    &usb1 {
    status = "disabled";
    };
    
    &cppi41dma {
    status = "okay";
    };

    I notice that if i boot with this device tree I get the following when I issue lsusb:

    root@am335x-evm:~# lsusb
    unable to initialize libusb: -99

    If I change the device tree to enable USB1 as host and USB0 as peripheral (as per the BeagleBoneBlack)
    there are errors reported at boot due to USB1_DRVVBUS and USB1_VBUS being tied together

    [ 20.576705] hub 1-0:1.0: USB hub found
    [ 20.607812] hub 1-0:1.0: 1 port detected
    [ 20.806757] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #1, port1 00000104
    [ 20.953090] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #2, port1 00000104
    [ 21.099411] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #3, port1 00000104
    [ 21.245761] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (80, <SessEnd), retry #3, port1 0008010c
    
    root@am335x-evm:~# lsusb
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation

    In each case enumeration of the g_ether gadget fails.

    I know I have had the BeagleBoneBlack working with an ethernet gadget - so given that my device tree looks so similar around the USB exctions when I inspect it using fdtdump

            usb@47400000 {
                compatible = "ti,am33xx-usb";
                reg = <0x47400000 0x000001db>;
                ranges;
                #address-cells = <0x00000001>;
                #size-cells = <0x00000001>;
                ti,hwmods = "usb_otg_hs";
                status = "okay";
                control@44e10620 {
                    compatible = "ti,am335x-usb-ctrl-module";
                    reg = <0x44e10620 0x00000003 0x6374726c 0x00000005>;
                    reg-names = "phy_ctrl", "wakeup";
                    status = "okay";
                    linux,phandle = <0x00000045>;
                    phandle = <0x00000045>;
                };
                usb-phy@47401300 {
                    compatible = "ti,am335x-usb-phy";
                    reg = <0x47401300 0x000001e2>;
                    reg-names = "phy";
                    status = "okay";
                    ti,ctrl_mod = <0x00000045>;
                    linux,phandle = <0x00000046>;
                    phandle = <0x00000046>;
                };
                usb@47401000 {
                    compatible = "ti,musb-am33xx";
                    status = "okay";
                    reg = <0x47401400 0x00000003 0x6f6e7472 0x000001c1>;
                    reg-names = "mc", "control";
                    interrupts = <0x00000012>;
                    interrupt-names = "mc";
                    dr_mode = "peripheral";
                    mentor,multipoint = <0x00000001>;
                    mentor,num-eps = <0x00000010>;
                    mentor,ram-bits = <0x0000000c>;
                    mentor,power = <0x000001f4>;
                    phys = <0x00000046>;
                    dmas = <0x00000047 0x00000001 0x00000000 0x00000047 0x00000005 0x00000000 0x00000047 0x00000009 0x00000000 0x00000047 0x0000000d 0x00000000 0x00000047 0x00000002 0x00000001 0x00000047 0x00000006 0x00000001 0x00000047 0x0000000a 0x00000001 0x00000047 0x0000000e 0x000003b0 0x72783400 0x72783800 0x31007278 0x00727831 0x33007478 0x37007478 0x78313100 0x31340074 0x7573622d 0x00000000 0x74692c61 0x79000000 0x47401b00 0x000001e2 0x000003a4 0x00000003 0x00000003 0x00000003 0x00000002 0x31383030 0x0000001b 0x78780000 0x64697361 0x00000010 0x47401800 0x000001e2 0x00000003 0x00000003 0x00000003 0x00000000 0x00000001 0x00000010 0x0000000c 0x000001f4 0x00000048 0x00000047 0x00000010 0x00000000 0x00000047 0x00000014 0x00000000 0x00000047 0x00000018 0x00000000 0x00000047 0x0000001c 0x00000000 0x00000047 0x00000011 0x00000001 0x00000047 0x00000015 0x00000001 0x00000047 0x00000019 0x00000001 0x00000047 0x0000001d 0x000003b0 0x72783400 0x72783800 0x31007278 0x00727831 0x33007478 0x37007478 0x78313100>;
                    dma-names = "rx1", "rx2", "rx3", "rx4", "rx5", "rx6", "rx7", "rx8", "rx9", "rx10", "rx11", "rx12", "rx13", "rx14", "rx15", "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7", "tx8", "tx9", "tx10", "tx11", "tx12", "tx13", "tx14", "tx15";
                };
                usb-phy@47401b00 {
                    compatible = "ti,am335x-usb-phy";
                    reg = <0x47401b00 0x000001e2>;
                    reg-names = "phy";
                    status = "disabled";
                    ti,ctrl_mod = <0x00000045>;
                    linux,phandle = <0x00000048>;
                    phandle = <0x00000048>;
                };
                usb@47401800 {
                    compatible = "ti,musb-am33xx";
                    status = "disabled";
                    reg = <0x47401c00 0x00000003 0x6f6e7472 0x000001c1>;
                    reg-names = "mc", "control";
                    interrupts = <0x00000013>;
                    interrupt-names = "mc";
                    dr_mode = "host";
                    mentor,multipoint = <0x00000001>;
                    mentor,num-eps = <0x00000010>;
                    mentor,ram-bits = <0x0000000c>;
                    mentor,power = <0x000001f4>;
                    phys = <0x00000048>;
                    dmas = <0x00000047 0x00000010 0x00000000 0x00000047 0x00000014 0x00000000 0x00000047 0x00000018 0x00000000 0x00000047 0x0000001c 0x00000000 0x00000047 0x00000011 0x00000001 0x00000047 0x00000015 0x00000001 0x00000047 0x00000019 0x00000001 0x00000047 0x0000001d 0x000003b0 0x72783400 0x72783800 0x31007278 0x00727831 0x33007478 0x37007478 0x78313100 0x31340074 0x646d612d 0x37343032 0x0000001b 0x70693431 0x000000be 0x00001000 0x00004000 0x676c7565 0x73636865 0x67720000 0x00000011 0x676c7565 0x0000030d 0x00000627 0x00000635 0x000003a4 0x00000004 0x00000004 0x00000002 0x38333030 0x0000001b 0x6d737300 0x48300000 0x000001cc 0x00000004 0x00000004 0x00000009 0x00000000 0x48300100 0x48300180 0x00000080 0x30303130 0x0000001b 0x61700000 0x00000003 0x48300100 0x000001c1 0x00000357 0x00000009 0x00000000 0x34383330 0x00000011 0x782d6568 0x00000004 0x00000008 0x00000003 0x00000003 0x6b000000 0x64697361 0x00000002 0x38333032 0x0000001b 0x6d737300 0x48302000 0x000001cc 0x00000004 0x00000004 0x00000009>;
                    dma-names = "rx1", "rx2", "rx3", "rx4", "rx5", "rx6", "rx7", "rx8", "rx9", "rx10", "rx11", "rx12", "rx13", "rx14", "rx15", "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7", "tx8", "tx9", "tx10", "tx11", "tx12", "tx13", "tx14", "tx15";
                };
                dma-controller@47402000 {
                    compatible = "ti,am3359-cppi41";
                    reg = <0x47400000 0x47403000 0x00000003 0x00636f6e 0x64756c65 0x00000003 0x00000003 0x00000000>;
                    reg-names = "glue", "controller", "scheduler", "queuemgr";
                    interrupts = <0x00000011>;
                    interrupt-names = "glue";
                    #dma-cells = <0x00000002>;
                    #dma-channels = <0x0000001e>;
                    #dma-requests = <0x00000100>;
                    status = "okay";
                    linux,phandle = <0x00000047>;
                    phandle = <0x00000047>;
                };
            };

    and given that the bare chip will enumerate successfully as a COM port I think there must be something trivial I am missing

    Thanks again for the help.

    Best regards,

    Richard

  • Running the beagle bone black beside my board I notice that the debugfs listing is different in the musb area

    BeagleBoneBlack Custom Board

    root@am335x-evm://proc/sys/debug# ls -l
    drwxr-xr-x 3 root root 0 Jan 1 1970 asoc
    drwxr-xr-x 15 root root 0 Jan 1 1970 bdi
    drwxr-xr-x 2 root root 0 Oct 3 21:05 bluetooth
    drwxr-xr-x 85 root root 0 Jan 1 1970 clk
    drwxr-xr-x 2 root root 0 Jan 1 1970 dma_buf
    drwxr-xr-x 6 root root 0 Jan 1 1970 dri
    drwxr-xr-x 2 root root 0 Jan 1 1970 extfrag
    -rw-r--r-- 1 root root 0 Jan 1 1970 fault_around_bytes
    -r--r--r-- 1 root root 0 Jan 1 1970 gpio
    drwxr-xr-x 2 root root 0 Jan 1 1970 hid
    drwxr-xr-x 2 root root 0 Jan 1 1970 iio
    drwxr-xr-x 2 root root 0 Jan 1 1970 memblock
    drwxr-xr-x 3 root root 0 Jan 1 1970 mmc0
    drwxr-xr-x 3 root root 0 Jan 1 1970 mmc1
    drwxr-xr-x 2 root root 0 Oct 3 21:05 musb-hdrc.1.auto
    drwxr-xr-x 2 root root 0 Oct 3 21:05 musb-hdrc.1.auto.dsps
    drwxr-xr-x 2 root root 0 Oct 3 21:05 musb-hdrc.2.auto
    drwxr-xr-x 2 root root 0 Oct 3 21:05 musb-hdrc.2.auto.dsps
    drwxr-xr-x 3 root root 0 Jan 1 1970 omap_mux
    drwxr-xr-x 3 root root 0 Jan 1 1970 opp
    drwxr-xr-x 3 root root 0 Jan 1 1970 pinctrl
    drwxr-xr-x 8 root root 0 Jan 1 1970 pm_debug
    drwxr-xr-x 2 root root 0 Jan 1 1970 pm_qos
    -r--r--r-- 1 root root 0 Jan 1 1970 pwm
    drwxr-xr-x 2 root root 0 Jan 1 1970 ras
    drwxr-xr-x 3 root root 0 Jan 1 1970 regmap
    drwxr-xr-x 11 root root 0 Jan 1 1970 regulator
    drwxr-xr-x 5 root root 0 Oct 3 21:05 remoteproc
    -rw-r--r-- 1 root root 0 Jan 1 1970 sched_features
    -r--r--r-- 1 root root 0 Jan 1 1970 sleep_time
    -r--r--r-- 1 root root 0 Jan 1 1970 suspend_stats
    drwxr-xr-x 2 root root 0 Jan 1 1970 ubi
    drwxr-xr-x 2 root root 0 Jan 1 1970 ubifs
    drwxr-xr-x 2 root root 0 Oct 3 21:05 usb
    -r--r--r-- 1 root root 0 Jan 1 1970 wakeup_sources

    root@am335x-evm:/proc/sys/debug# ls -l
    drwxr-xr-x 2 root root 0 Jan 1 1970 asoc
    drwxr-xr-x 12 root root 0 Jan 1 1970 bdi
    drwxr-xr-x 2 root root 0 Oct 3 21:05 bluetooth
    drwxr-xr-x 83 root root 0 Jan 1 1970 clk
    drwxr-xr-x 2 root root 0 Jan 1 1970 dma_buf
    drwxr-xr-x 2 root root 0 Oct 3 21:05 dri
    drwxr-xr-x 2 root root 0 Jan 1 1970 extfrag
    -rw-r--r-- 1 root root 0 Jan 1 1970 fault_around_bytes
    -r--r--r-- 1 root root 0 Jan 1 1970 gpio
    drwxr-xr-x 2 root root 0 Jan 1 1970 hid
    drwxr-xr-x 2 root root 0 Jan 1 1970 iio
    drwxr-xr-x 2 root root 0 Jan 1 1970 memblock
    drwxr-xr-x 3 root root 0 Jan 1 1970 mmc0
    drwxr-xr-x 2 root root 0 Jan 1 1970 mmc1
    drwxr-xr-x 2 root root 0 Oct 3 21:05 musb-hdrc.0.auto
    drwxr-xr-x 2 root root 0 Oct 3 21:05 musb-hdrc.0.auto.dsps
    drwxr-xr-x 2 root root 0 Oct 3 21:05 musb-hdrc.1.auto
    drwxr-xr-x 2 root root 0 Oct 3 21:05 musb-hdrc.1.auto.dsps
    drwxr-xr-x 3 root root 0 Jan 1 1970 omap_mux
    drwxr-xr-x 3 root root 0 Jan 1 1970 opp
    drwxr-xr-x 3 root root 0 Jan 1 1970 pinctrl
    drwxr-xr-x 8 root root 0 Jan 1 1970 pm_debug
    drwxr-xr-x 2 root root 0 Jan 1 1970 pm_qos
    -r--r--r-- 1 root root 0 Jan 1 1970 pwm
    drwxr-xr-x 2 root root 0 Jan 1 1970 ras
    drwxr-xr-x 3 root root 0 Jan 1 1970 regmap
    drwxr-xr-x 12 root root 0 Jan 1 1970 regulator
    drwxr-xr-x 3 root root 0 Oct 3 21:05 remoteproc
    -rw-r--r-- 1 root root 0 Jan 1 1970 sched_features
    -r--r--r-- 1 root root 0 Jan 1 1970 sleep_time
    -r--r--r-- 1 root root 0 Jan 1 1970 suspend_stats
    drwxr-xr-x 2 root root 0 Jan 1 1970 ubi
    drwxr-xr-x 2 root root 0 Jan 1 1970 ubifs
    drwxr-xr-x 2 root root 0 Oct 3 21:05 usb
    -r--r--r-- 1 root root 0 Jan 1 1970 wakeup_sources

    I cannot think of any reason for these differences

     - they are running the same kernel 

     - Linux version 4.4.19-gdb0b54cdad (gtbldadm@ubuntu-16) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #1 PREEMPT Mon Oct 3 17:43:466

    Thanks

    Richard

  • comparing a USB traces from the attachment of my board with that of the beaglebone black

    I can see that the info looks reasonably formed
    - just containing the wrong information

    hexdump failed_enumeration

    00000000: A0 00 5C 00 3F 00 3F 00 - 5C 00 55 00 53 00 42 00 | \ ? ? \ U S B |
    00000010: 23 00 56 00 49 00 44 00 - 5F 00 30 00 30 00 30 00 |# V I D _ 0 0 0 |
    00000020: 30 00 26 00 50 00 49 00 - 44 00 5F 00 30 00 30 00 |0 & P I D _ 0 0 |
    00000030: 30 00 34 00 23 00 35 00 - 26 00 33 00 33 00 65 00 |0 4 # 5 & 3 3 e |
    00000040: 62 00 37 00 62 00 37 00 - 30 00 26 00 30 00 26 00 |b 7 b 7 0 & 0 & |
    00000050: 31 00 30 00 23 00 7B 00 - 61 00 36 00 37 00 38 00 |1 0 # { a 6 7 8 |
    00000060: 32 00 62 00 63 00 65 00 - 2D 00 34 00 33 00 37 00 |2 b c e - 4 3 7 |
    00000070: 36 00 2D 00 34 00 64 00 - 65 00 32 00 2D 00 38 00 |6 - 4 d e 2 - 8 |
    00000080: 39 00 65 00 38 00 66 00 - 65 00 64 00 31 00 39 00 |9 e 8 f e d 1 9 |
    00000090: 7D - |}|
    00000091;

    hexdump successful_enumeration

    00000000: 9A 00 5C 00 3F 00 3F 00 - 5C 00 55 00 53 00 42 00 | \ ? ? \ U S B |
    00000010: 23 00 56 00 49 00 44 00 - 5F 00 31 00 44 00 36 00 |# V I D _ 1 D 6 |
    00000020: 42 00 26 00 50 00 49 00 - 44 00 5F 00 30 00 31 00 |B & P I D _ 0 1 |
    00000030: 30 00 34 00 23 00 30 00 - 35 00 31 00 34 00 42 00 |0 4 # 0 5 1 4 B |
    00000040: 42 00 42 00 4B 00 33 00 - 34 00 39 00 30 00 23 00 |B B K 3 4 9 0 # |
    00000050: 7B 00 61 00 36 00 37 00 - 38 00 32 00 62 00 63 00 |{ a 6 7 8 2 b c |
    00000060: 65 00 2D 00 34 00 33 00 - 37 00 36 00 2D 00 34 00 |e - 4 3 7 6 - 4 |
    00000070: 64 00 65 00 32 00 2D 00 - 38 00 30 00 39 00 36 00 |d e 2 - 8 0 9 6 |
    00000080: 2D 00 37 00 30 00 61 00 - 61 00 39 00 65 00 38 00 |- 7 0 a a 9 e 8 |
    00000090: 66 00 65 00 64 00 31 00 - 39 00 7D 00 43 02 EB 2A |f e d 1 9 } C *|
    000000a0: 6E 6A 6B 48 82 FC D8 15 - F6 B9 70 06 28 00 01 00 |njkH p ( |
    000000b0: BB 00 00 C0 00 00 00 00 - 00 00 00 00 43 02 EB 2A | C *|
    000000c0: 6E 6A 6B 48 82 FC D8 15 - F6 B9 70 06 28 00 01 00 |njkH p ( |
    000000d0: BB 00 00 C0 00 00 00 00 - 00 00 00 00 88 00 0B 00 | |

    is there some magic done at linux boot based on detection of being run on a beagleBoneBlack that might be causing the difference?

    Thanks

    - Richard

  • Richard McAleer said:

    I have removed the gadget service as suggested and can now try to launch g_ether.

    ...

    The results however are the same - in that it does not enumerate properly for my PC

    Please use a USB protocol analyzer to capture the numeration trace, it might give an idea why it fails. If you don't have an analyzer, please connect your board to a Linux PC, then run usbmon on the PC to capture the USB traffic. The usbmon trace is harder to read than an analyzer trace though.

    For how to use usbmon, please check the kernel doc: Documentation/usb/usbmon.txt.

    Richard McAleer said:

    I notice that if i boot with this device tree I get the following when I issue lsusb:

    root@am335x-evm:~# lsusb
    unable to initialize libusb: -99

    Let's focus on usb0 first, then figure out how to disable usb1 on your board.

  • Richard McAleer said:

    Running the beagle bone black beside my board I notice that the debugfs listing is different in the musb area

    ...

    I cannot think of any reason for these differences

    The difference is in the index of the musb nodes, The musb node naming is based on a kernel global index, so depending on the presence of other peripherals on each system, the index of musb nodes could be different. This difference doesn't affect the usb function.

    FYI, to avoid this confusion, this musb naming is changed in kernel v4.9, in which the musb nodes will be "musb-hdrc.0" and "musb-hdrc.1".

  • Richard McAleer said:

    comparing a USB traces from the attachment of my board with that of the beaglebone black

    I can see that the info looks reasonably formed
    - just containing the wrong information

    hexdump failed_enumeration

    ...

    
    

    How did you get this dump? From the Windows host? I am not familiar with Windows USB subsystem, please as I recommended above, debug it with a Linux host PC.

  • Richard McAleer said:

    The DTS settings to support this are:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    &usb {
    status = "okay";
    };
    &usb_ctrl_mod {
    status = "okay";
    };
    &usb0_phy {
    status = "okay";
    };
    &usb1_phy {
    status = "disabled";
    };
    &usb0 {
    status = "okay";
    dr_mode = "peripheral";
    };
    &usb1 {
    status = "disabled";
    };
    &cppi41dma {
    status = "okay";
    };

    I notice that if i boot with this device tree I get the following when I issue lsusb:

    1
    2
    root@am335x-evm:~# lsusb
    unable to initialize libusb: -99

    The dts changes above are okay to disable usb1. the lsusb error can be ignored, since there is no usb host configuration in your system. I validated this dts change on AM335x GP EVM, and g_ether can be enumerated on Linux PC.

  • Hi

    the DTS changes are based on am335x-bone-common.dtsi 
    - if I remove that dr_mode setting there it will pickup the dr_mode="otg" from am33xx.dtsi 
    - I don't think that is expected to work with the schematics as per the beagle bone black (there is no control over VBUS)

    I have tried it however and the result is the same:

    - it claims a hub when I issue lsusb
    - the enumeration of the device fails

    [ 645.717692] using random self ethernet address
    [ 645.723205] using random host ethernet address
    [ 645.767520] usb0: HOST MAC 06:44:9a:50:15:18
    [ 645.774714] usb0: MAC b6:aa:7d:f5:97:63
    [ 645.791986] using random self ethernet address
    [ 645.805681] using random host ethernet address
    [ 645.814053] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
    [ 645.838987] g_ether gadget: g_ether ready

    root@am335x-evm:/proc/sys/debug# cat usb/devices 
    
    T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
    B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
    D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=1d6b ProdID=0002 Rev= 4.04
    S:  Manufacturer=Linux 4.4.19-gdb0b54cdad musb-hcd
    S:  Product=MUSB HDRC host driver
    S:  SerialNumber=musb-hdrc.1.auto
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms
    root@am335x-evm:/proc/sys/debug# 
    

    I am surprised by the fact that there appears to be something else on the usb bus in the beagle bone black:
     - I had expected from the schematics and device tree that these two subsystems should be identical between the boards.

    (looking at the device-tree in the filesystem e.g. via

    root@am335x-evm:/proc/device-tree/ocp/usb@47400000# find . -type f -print -exec hexdump -C {} \;

    the only differences are in the value inside the phandle entries

    e.g. 

    ./usb-phy@47401b00/linux,phandle
    00000000 00 00 00 48 |...H| 

    vs

    ./usb-phy@47401b00/linux,phandle
    00000000 00 00 00 41

     - is it possible to determine what has been given the missing enumeration index in the case of the beagle bone black? I would be interested to know how to work out what causes the differences

    I will try and live boot to linux to capture a usbtrace that works better for you

    hopefully I will have the results of that shortly

    Thanks for the hekp

    Best regards,

    Richard

  • HI

    I've hopefully captured a failed enumeration in the attached txt file

    The logs via dmesg for this fail are 

    [  157.064860] usb 1-10: new high-speed USB device number 5 using xhci_hcd
    [  157.193213] usb 1-10: device descriptor read/all, error -71
    [  157.304849] usb 1-10: new high-speed USB device number 6 using xhci_hcd
    [  157.420990] usb 1-10: Device not responding to setup address.
    [  157.625043] usb 1-10: Device not responding to setup address.
    [  157.828914] usb 1-10: device not accepting address 6, error -71
    [  157.940946] usb 1-10: new high-speed USB device number 7 using xhci_hcd
    [  157.957942] usb 1-10: device descriptor read/all, error -71
    [  158.124980] usb 1-10: new high-speed USB device number 8 using xhci_hcd
    [  158.125141] usb 1-10: Device not responding to setup address.
    [  158.329113] usb 1-10: Device not responding to setup address.
    [  158.532947] usb 1-10: device not accepting address 8, error -71
    [  158.533043] usb usb1-port10: unable to enumerate USB device
    
    ubuntu@ubuntu:~$

     

    the devices attached at the time were

    ubuntu@ubuntu:~$ lsusb
    
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 004: ID 0781:5567 SanDisk Corp. Cruzer Blade
    Bus 001 Device 003: ID 413c:2113 Dell Computer Corp.
    Bus 001 Device 002: ID 413c:301a Dell Computer Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    
    ubuntu@ubuntu:~$

    I removed as much as I could from the system beforehand so that there was as little spurious info as possible: 
    - there was only a keyboard, mouse and flash drive (containing the live boot distro)

    Hopefully there is a clue or two in the data

    4428.usb_dump.txt

    Thanks for the help

    All the best,

    - Richard

  • Richard,

    I read the usbmon dump trace, it basically tells the same as that in the Linux host dmesg log - the device (am335x g_ether gadget) doesn't send the descriptors and the enumeration failed.

    I suspect you have signal integrity problem on your board, so please check the followings.

    - ensure you have followed the usb layout guidelines;

    - If possible try with different USB cables to see if the symptom changes;

    - Check if you use a different crystal than that on the Beaglebone Black (which is 24MHz I think), ensure you have modified uboot for its config;

    - Measure the eyediagram;

  • Richard,

    These are not related to your usb issue, but I am trying to answer your questions.

    Richard McAleer said:
    the DTS changes are based on am335x-bone-common.dtsi 
    - if I remove that dr_mode setting there it will pickup the dr_mode="otg" from am33xx.dtsi 

    Correct.

    Richard McAleer said:
    - I don't think that is expected to work with the schematics as per the beagle bone black (there is no control over VBUS)

    Setting dr_mode = "otg" on your board will not create any issue, the setting only tells the driver to handle "otg" operations, but since your board would only have mini-B or micro-B receptacle, the usb port will only works in device mode, which is a part of otg.

    Richard McAleer said:
    root@am335x-evm:/proc/sys/debug# cat usb/devices
    ...

    This information is irrelevant, it is for the host ports, not device.

    Richard McAleer said:
    I am surprised by the fact that there appears to be something else on the usb bus in the beagle bone black:

    This is because the usb1 on the BBB is a host port, what you see is the virtual root hub on that usb bus.

    Richard McAleer said:
    the only differences are in the value inside the phandle entries

    phandle is a pointer, so it could be different on each system.

    Richard McAleer said:
     - is it possible to determine what has been given the missing enumeration index in the case of the beagle bone black? I would be interested to know how to work out what causes the differences

    Sure, please run the following command on your board

    # find /sys -name '*.0.auto'

    you will find a device which name has '0.auto' surfix, but it is not related to usb. Basically any kernel device driver, which uses kernel global index naming scheme, will have ".<index>.auto" surfix in its device name, the index is global.

  • Thanks Bin

    I really appreciate your efforts - understanding what's going on is as much a motive for myself as getting this to work

    I will see what i can do to investigate the signal integrity and liaise with our HW designer regarding your points.

    I can get my hands on a GHz scope to try and capture the eye but I am unsure as to how much data there will be during the failed enumeration to allow me to see it?
    - I will give it a go shortly

    In the meantime I have managed to find a dedicated HW USB analyser.
    This shows a difference in the enumeration process between the bare chip (successful serial port enumeration) and the failing kernel g_ether.

    Filename: failed_g_ether_enumeration.ufo Filename: bare_board_enumeration.ufo

    Reset duration<55.1 milliseconds> time<10.363 339 933>
    ______________________________________________________________________________
    HighSpeedHandshake status<Success> time<10.418 145 983>
    ______________________________________________________________________________
    ConsecutiveSof count<263> time<10.418 433 933>
    ______________________________________________________________________________
    Container title<GetDescriptor (Device)> device<0> endpoint<0> status<INVALID>
    speed<HS> time<10.451 257 550>
    Transaction type<SETUP> device<0> endpoint<0> status<INCOMPLETE> speed<HS>
    time<10.451 257 550> errors<malformedTransaction>
    ______________________________________________________________________________
    Container title<GetDescriptor (Device)> device<0> endpoint<0> status<INVALID>
    speed<HS> time<10.451 261 850>
    Transaction type<SETUP> device<0> endpoint<0> status<INCOMPLETE> speed<HS>
    time<10.451 261 850> errors<malformedTransaction>
    ____________________________________________________________________________

    Reset duration<54.8 milliseconds> time<0.311 983 933>
    ______________________________________________________________________________
    HighSpeedHandshake status<UpstreamPortChirpKTimeout> time<0.321 996 600>
    ______________________________________________________________________________
    ConsecutiveSof count<33> time<0.367 219 217>
    ______________________________________________________________________________
    Container title<GetDescriptor (Device)> device<0 (64)> endpoint<0> status<OK>
    speed<FS> time<0.400 080 883>
    Transaction type<SETUP> device<0 (64)> endpoint<0> status<ACK> speed<FS>
    time<0.400 080 883>
    Transaction type<IN> device<0 (64)> endpoint<0> status<NAK> speed<FS>
    time<0.400 107 267>
    Transaction type<IN> device<0 (64)> endpoint<0> status<ACK> speed<FS>
    time<0.400 133 400>
    Transaction type<OUT> device<0 (64)> endpoint<0> status<ACK> speed<FS>
    time<0.400 164 717>
    ______________________________________________________________________________
    StartOfFrame frameNumber<2,045> speed<FS> time<0.400 220 867>
    ______________________________________________________________________________

    In essence it appears that the bare chip enumeration works because it stays in FullSpeed mode (ignoring the chirps that would indicate HS operation)

    While this  also points to a possible signal integrity issue it raises the question as to whether I can hobble the PHY to remain at FullSpeed rates when the kernel is running?

    - I am not concerned about the throughput for the g_ether gadget and would happily put up with a slow connection
    - is there configuration available to do this? (or can I patch the code directly leaving the g_ether able to run?)

    Thanks for all your help.

    Best regards,

    Richard

  • Richard McAleer said:
    I really appreciate your efforts - understanding what's going on is as much a motive for myself as getting this to work

    You are welcome. I try my best to help solving the issue.

    Richard McAleer said:

    I can get my hands on a GHz scope to try and capture the eye but I am unsure as to how much data there will be during the failed enumeration to allow me to see it?
    - I will give it a go shortly

    For eyediagram test, you don't need to wait until the failure happens, just hook up the scope and capture the signal, the eye will tell the signal quality. 

    But please don't forget to check the crystal first as I mentioned, it could be overlooked.

    Richard McAleer said:

    While this  also points to a possible signal integrity issue it raises the question as to whether I can hobble the PHY to remain at FullSpeed rates when the kernel is running?

    Yes, it is possible. Just add maximum-speed = "full-speed" into your dts usb0 node. For example

    diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
    index e8c1edcac9e9..245e6934ed7e 100644
    --- a/arch/arm/boot/dts/am335x-evm.dts
    +++ b/arch/arm/boot/dts/am335x-evm.dts
    @@ -426,6 +426,7 @@
     
     &usb0 {
            status = "okay";
    +       maximum-speed = "full-speed";
     };
     
     &usb1 {
    
    
  • Hi Bin

    I missed your comment earlier about the Crystal - that indeed appears to be the problem!

    Thanks for pointing me in that direction.

    Is it possible to check or set the registers/memory that is is used in from user space?
    I would like to put checks in so that our application was able to know whether the board it has been run on was configured correctly; this would help prevent similar future frustrations where our kernel had been reached via a different path.

    Thanks again for all your help.

    All the best,

    Richard

  • Richard McAleer said:
    I missed your comment earlier about the Crystal - that indeed appears to be the problem!

    Do you mean your board crystal is not 24MHz? and you are not sure if your uboot has been changed accordingly?

    I am traveling from tomorrow, so I will forward this thread to our uboot expert to help your checking the clock configuration.

  • Both!
    - configuring it properly solves the problem; allowing successful enumeration of usb gadgets at proper speed
  • Richard,

    Thanks for confirming. Do you mind to tell what is the crystal freq do you use?

  • Hi Bin

    we're using 25MHz
    - specifically a kc2016k25 part.

    Thanks again for the help.
    All the best,
    Richard
  • Thanks for the update. Glad you solved the issue.
  • No problem

    It's good to keep the information as up to date as possible in the forums to help the next guy with the same problem!

    One final question - do you know if it is possible to get g_ether style functionality from u-boot for an am335x?
    - it would be really useful to be able to boot with an rootfs over NFS via USB

    Thanks again for all the help.
    Best regards,
    Richard
  • Richard,

    Yes, usb ether gadget is supported in uboot too. Though I haven't used it for a very long time, so am not sure if it is enabled in the default build config.
    You have to use uboot command 'setenv ethact usb_ether' to switch to usb ethernet interface before do any tftp download.

  • Hi Bin

    it certainly looks enabled in my config; it's  setenv etcact usb_ether that is needed and appears to work well

    Thanks for all your help.

    Best regards,

    Richard