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.

AM3358: USB gadget problem

Other Parts Discussed in Thread: TPS65217

Dear Experts,

I would like to ask some help.

Our design is based on the OSD3358-512M-BSM SiP module. We stucked on a problem about USB1 bring-up as a device/gadget.

  • Our device use USB1 for device, USB0 will be a host
  • We use the OSD3358 VIN_USB port (this is the TPS65217 USB port)  instead of VIN_AC (this is the TPS65217 AC port) for supplying our system (we will need limit our device to 500mA)
  • We use Buildroot. U-boot ver is 2018.01 (Patched with eeprom check skip., octavosystems.com/.../ . Kernel is 5.4.28.

After several tests, here is our problem:

  • USB1 seems initializing at boot, gadget is created, but the state is "not attached" all the time
  • I  tried OTG and device sets from kernel tree. Same result
  • I tried my Linux firmware at a pocketbeagle board. If I use VIN_USB for supply (like on our board) on Pockebeagle , same problem, USB1 is not attached. If I supply my system over VIN_AC in pocketbeagle, the USB1 can enumerate and my gadget interface is shows up.

Some help for diagnostic

  • USB0 is not used currently, it is in host mode
  • We tried on 2 proto device at the same time to exclude asembly problems
  • R83 (VBUS connect over a 0Ohm resistor, checked, mounted)
  • R6 (USB1_ID is not mounted)
  • VIN_USB measured, it is exactly 5V
  • Our device contain a microSD card connector and an eMMC module. I tested the USb on our device when I just use eMMC. Same results, "not attached".

Thank you.

sbc.pdf

U-Boot SPL 2018.01 (Jun 08 2020 - 01:04:01)
Trying to boot from MMC2
reading u-boot.img
reading u-boot.img


U-Boot 2018.01 (Jun 08 2020 - 01:04:01 +0200)

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Model: BeagleBoard.org PocketBeagle
<ethaddr> not set. Validating first E-fuse MAC
Net:   usb_ether
Press SPACE to abort autoboot in 2 seconds
## Error: "findfdt" not defined
switch to partitions #0, OK
mmc0(part 0) is current device
SD/MMC found on device 0
** Bad device 0:2 0x82000000 **
** Bad device 0:2 0x82000000 **
switch to partitions #0, OK
mmc0(part 0) is current device
** No partition table - mmc 0 **
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
** No partition table - mmc 0 **
Checking for: /uEnv.txt ...
** No partition table - mmc 0 **
Checking for: /boot.scr ...
** No partition table - mmc 0 **
Checking for: /boot/boot.scr ...
** No partition table - mmc 0 **
Checking for: /boot/uEnv.txt ...
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
reading uEnv.txt
496 bytes read in 5 ms (96.7 KiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from /uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
gpio: pin 56 (gpio 56) value is 1
Running uenvcmd ...
reading zImage
5827288 bytes read in 389 ms (14.3 MiB/s)
reading tinysbc.dtb
54444 bytes read in 11 ms (4.7 MiB/s)
## Error: "mmcargs" not defined
## Flattened Device Tree blob at 80f80000
   Booting using the fdt blob at 0x80f80000
   Loading Device Tree to 8ffef000, end 8ffff4ab ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.28 (root@debian) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #53 SMP Sun May 31 02:09:49 CEST 2020
[    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] OF: fdt: Machine model: TinySBC Wireless
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x9e800000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] percpu: Embedded 19 pages/cpu s48780 r8192 d20852 u77824
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129412
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk1p2 rootfstype=ext4
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 486224K/522240K available (9216K kernel code, 724K rwdata, 2124K rodata, 1024K init, 257K bss, 19632K reserved, 16384K cma-reserved, 0K highmem)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[    0.000000] random: get_random_bytes called from start_kernel+0x2ac/0x4ec with crng_init=0
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000015] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000035] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000045] OMAP clocksource: timer1 at 24000000 Hz
[    0.000751] timer_probe: no matching timers found
[    0.001208] Console: colour dummy device 80x30
[    0.001234] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.001241] This ensures that you still see kernel messages. Please
[    0.001247] update your kernel commandline.
[    0.001287] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
[    0.089166] pid_max: default: 32768 minimum: 301
[    0.089352] LSM: Security Framework initializing
[    0.089450] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.089463] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090595] CPU: Testing write buffer coherency: ok
[    0.090663] CPU0: Spectre v2: using BPIALL workaround
[    0.091116] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.091892] Setting up static identity map for 0x80100000 - 0x80100078
[    0.092090] rcu: Hierarchical SRCU implementation.
[    0.092482] smp: Bringing up secondary CPUs ...
[    0.092494] smp: Brought up 1 node, 1 CPU
[    0.092503] SMP: Total of 1 processors activated (996.14 BogoMIPS).
[    0.092511] CPU: All CPU(s) started in SVC mode.
[    0.093139] devtmpfs: initialized
[    0.103997] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.104322] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.104352] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.105632] pinctrl core: initialized pinctrl subsystem
[    0.107102] NET: Registered protocol family 16
[    0.109850] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.136361] l3-aon-clkctrl:0000:0: failed to disable
[    0.137955] audit: initializing netlink subsys (disabled)
[    0.139080] cpuidle: using governor menu
[    0.158365] audit: type=2000 audit(0.130:1): state=initialized audit_enabled=0 res=1
[    0.159776] No ATAGs?
[    0.159785] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.180414] edma 49000000.edma: TI EDMA DMA engine driver
[    0.183766] iommu: Default domain type: Translated
[    0.185447] vgaarb: loaded
[    0.186027] SCSI subsystem initialized
[    0.187104] pps_core: LinuxPPS API ver. 1 registered
[    0.187117] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.187150] PTP clock support registered
[    0.188105] clocksource: Switched to clocksource timer1
[    0.646329] VFS: Disk quotas dquot_6.6.0
[    0.646446] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.656243] thermal_sys: Registered thermal governor 'fair_share'
[    0.656253] thermal_sys: Registered thermal governor 'step_wise'
[    0.656272] thermal_sys: Registered thermal governor 'user_space'
[    0.656825] NET: Registered protocol family 2
[    0.657631] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.657669] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.657712] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.657771] TCP: Hash tables configured (established 4096 bind 4096)
[    0.657885] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.657909] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.658194] NET: Registered protocol family 1
[    0.659177] RPC: Registered named UNIX socket transport module.
[    0.659193] RPC: Registered udp transport module.
[    0.659200] RPC: Registered tcp transport module.
[    0.659207] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.659222] PCI: CLS 0 bytes, default 64
[    0.660575] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.662172] Initialise system trusted keyrings
[    0.662551] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.663844] NFS: Registering the id_resolver key type
[    0.663896] Key type id_resolver registered
[    0.663906] Key type id_legacy registered
[    0.663951] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.664306] Key type asymmetric registered
[    0.664320] Asymmetric key parser 'x509' registered
[    0.664339] io scheduler mq-deadline registered
[    0.664348] io scheduler kyber registered
[    0.669162] OMAP GPIO hardware version 0.1
[    0.719031] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    0.722871] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
[    0.726291] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 29, base_baud = 3000000) is a 8250
[    1.328044] printk: console [ttyS0] enabled
[    1.345277] brd: module loaded
[    1.357328] loop: module loaded
[    1.362434] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.370701] libphy: Fixed MDIO Bus: probed
[    1.377219] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
[    1.386224] i2c /dev entries driver
[    1.391833] sdhci: Secure Digital Host Controller Interface driver
[    1.398051] sdhci: Copyright(c) Pierre Ossman
[    1.455596] omap_hsmmc 47810000.mmc: RX DMA channel request failed
[    1.462538] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.468956] ledtrig-cpu: registered to indicate activity on CPUs
[    1.476776] oprofile: using arm/armv7
[    1.480892] Initializing XFRM netlink socket
[    1.485392] NET: Registered protocol family 10
[    1.491284] Segment Routing with IPv6
[    1.495110] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.501924] NET: Registered protocol family 17
[    1.506420] NET: Registered protocol family 15
[    1.511046] Key type dns_resolver registered
[    1.515422] ThumbEE CPU extension supported.
[    1.519758] Registering SWP/SWPB emulation handler
[    1.524576] omap_voltage_late_init: Voltage driver support not added
[    1.530990] sr_dev_init: Unknown instance smartreflex0
[    1.536414] SmartReflex Class3 initialized
[    1.541261] Loading compiled-in X.509 certificates
[    1.569006] mmc0: new high speed MMC card at address 0001
[    1.575460] mmcblk0: mmc0:0001 IS016G 14.6 GiB
[    1.580459] mmcblk0boot0: mmc0:0001 IS016G partition 1 4.00 MiB
[    1.586727] mmcblk0boot1: mmc0:0001 IS016G partition 2 4.00 MiB
[    1.593242] mmcblk0rpmb: mmc0:0001 IS016G partition 3 4.00 MiB, chardev (248:0)
[    1.606779] random: fast init done
[    1.621335] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    1.626814] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.632589] mmc1: host does not support reading read-only switch, assuming write-enable
[    1.641648] hctosys: unable to open rtc device (rtc0)
[    1.648427] mmc1: new high speed SDHC card at address 0007
[    1.655263] mmcblk1: mmc1:0007 SD08G 7.42 GiB
[    1.661839]  mmcblk1: p1 p2
[    1.670027] EXT4-fs (mmcblk1p2): INFO: recovery required on readonly filesystem
[    1.677388] EXT4-fs (mmcblk1p2): write access will be enabled during recovery
[    3.799210] EXT4-fs (mmcblk1p2): recovery complete
[    3.810393] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
[    3.818693] VFS: Mounted root (ext4 filesystem) readonly on device 179:26.
[    3.834747] devtmpfs: mounted
[    3.839111] Freeing unused kernel memory: 1024K
[    3.844134] Run /sbin/init as init process
[    3.973265] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Populating /dev using udev: [    4.214960] udevd[103]: starting version 3.2.9
[    4.259831] random: udevd: uninitialized urandom read (16 bytes read)
[    4.269095] random: udevd: uninitialized urandom read (16 bytes read)
[    4.275694] random: udevd: uninitialized urandom read (16 bytes read)
[    4.334299] udevd[104]: starting eudev-3.2.9
[    4.967365] tps6521x_pwrbutton tps65217-pwrbutton: DMA mask not set
[    5.008716] am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
[    5.041866] wkup_m3_ipc 44e11324.wkup_m3_ipc: IPC Request for A8->M3 Channel failed! -517
[    5.071513] remoteproc remoteproc0: wkup_m3 is available
[    5.082765] input: tps65217_pwrbutton as /devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0
[    5.119216] wkup_m3_ipc 44e11324.wkup_m3_ipc: IPC Request for A8->M3 Channel failed! -517
[    5.138821] omap_rtc 44e3e000.rtc: registered as rtc0
[    5.145496] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    5.363442] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    5.456258] remoteproc remoteproc0: powering up wkup_m3
[    5.532283] remoteproc remoteproc0: Direct firmware load for am335x-pm-firmware.elf failed with error -2
[    5.541992] remoteproc remoteproc0: request_firmware failed: -2
[    5.547945] wkup_m3_ipc 44e11324.wkup_m3_ipc: rproc_boot failed
[    5.630999] omap_rng 48310000.rng: Random Number Generator ver. 20
[    5.637916] random: crng init done
[    5.641488] random: 1 urandom warning(s) missed due to ratelimiting
[    5.919783] PM: Cannot get wkup_m3_ipc handle
[    6.352450] musb-dsps 47401c00.usb: IRQ vbus not found
[    6.361967] using random self ethernet address
[    6.366442] using random host ethernet address
[    6.371794] usb0: HOST MAC 06:a4:7c:f7:4b:e2
[    6.376154] usb0: MAC 42:be:94:ca:c8:59
[    6.380118] using random self ethernet address
[    6.384583] using random host ethernet address
[    6.389272] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[    6.395918] g_ether gadget: g_ether ready
[    6.448538] PM: Cannot get wkup_m3_ipc handle
[    6.471187] PM: Cannot get wkup_m3_ipc handle
done
Initializing random number generator: OK
Saving random seed: OK
Starting network: OK

Welcome to tinysbc-wireless
tinysbc-wireless login: root
Password:
# cat /sys/class/udc/musb-hdrc.1/
a_alt_hnp_support  device/            is_selfpowered     srp
a_hnp_support      function           maximum_speed      state
b_hnp_enable       is_a_peripheral    power/             subsystem/
current_speed      is_otg             soft_connect       uevent
# cat /sys/class/udc/musb-hdrc.1/state
not attached