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: Unable to enable USB OTG

Part Number: AM3358

Tool/software:

I have a custom AM3358 board running Linux 5.15.0 that is currently set up to use USB0 as a peripheral with mass storage and ethernet gadgets and USB1 as a host connected to a modem. These features work as expected. I am trying to experiment with setting up USB0 to be OTG, but without success. The initial test is to see if something happens when I plug in a flash drive, but I have not observed any change. I am not sure if there is a configuration problem, or if the hardware design is incapable of supporting OTG.

Here is a description of the USB0 circuit: the USB0_VBUS pin on the AM3358 is not connected to the VBUS pin on the connector, but is rather permanently pulled high through a ferrite bead. USB0_ID is also not currently attached to the USB connector; it floats, but I can manually connect it to ground. I do not have access to either USB0_VBUS or USB0_DRVVBUS pins. (FYI, USB1, which is set up as a USB host, likewise has USB1_VBUS permanently pulled high, and has USB1_ID connected to ground.) My understanding from the documentation is that USB0_ID controls the OTG mode: ground => host, floating => peripheral. (Question: is USB_ID supposed to be pulled high internally? I do not see any voltage on it.) The board has a microUSB-B jack (female). For the purpose of this test, I am using a USB-A female to microUSB-B male adapter and a USB-A splitter so that I can externally apply 5V to the cable-combination VBUS. Before inserting the flash drive, I manually apply ground to USB0_ID. This particular flash drive momentarily lights up since power is present, but there is no indication of detection or access in the AM3358 console terminal or in dmesg.

Question: can this hardware setup work as is? The AM3358 should detect that USB0_VBUS is greater than 4.4V because it is pulled high, but does it expect it go low before going high? If it can work, am I making the right assumptions about the test setup (in particular USB0_ID)?

If it can work, then I wonder if I do not have the correct kernel configuration. I have set usb0 dr_mode="otg". In addition to the original setup for USB functionality (with usb0 dr_mode="peripheral" and usb1 dr_mode="host"), I have added CONFIG_USB_OTG=y and tried with and without CONFIG_USB_ROLE_SWITCH=y. The complete USB configuration is:

CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_OTG=y
CONFIG_USB_ACM=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_AM35X=y
CONFIG_USB_MUSB_DSPS=y
CONFIG_USB_TI_CPPI41_DMA=y
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_SIERRAWIRELESS=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_AM335X_PHY_USB=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG=y
CONFIG_USB_GADGET_VERBOSE=y
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=32
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_ROLE_SWITCH=y

(I also added CONFIG_USB_GADGET_DEBUG and CONFIG_USB_GADGET_VERBOSE, but I do not see any additional logging output.)

If it is of any help, I also ran the 8105.chkusb.sh script I found in the response to a similar question in the forum:

Question: am I missing something from the configuration?

Thanks for any help you can provide. Please let me know if I can supply any additional information.

dave

  • Hi Dave,

    Thanks for the details.

    I doubt this experiment will work, as it violates the USB Specifications in a few perspective, mainly in the USB device attach.

    By the Specs, the OTG mode should use micro-AB receptacle which has a ID pin. The AM335x USB0_ID pin should connect to the receptacle ID pin, which will be grounded when a USB device is attached. And USB0_VBUS should connect to the on-board VBUS power switch and the USB receptacle VBUS pin. But in practice, you could manually ground USB0_ID pin before attaching a USB device. This is basically the similar design as USB1 on your board too.

    But the problem is on the USB0_VBUS pin connection and external power to the USB device in your experiment. The AM335x TRM has description about the AM335x VBUS sensing, and the USB2.0 Specs has description about the timing of USB device VBUS power and DP/DM pullup.

    Thanks for providing the log of chkusb.sh script, it shows USB0 is in peripheral mode (musb-hdrc.0: mode b_peripheral). I have never done such experiment before, but I believe the problem is the order of VBUS on and grounding ID pin:

    1. When VBUS is on while ID pin is float, the USB controller goes to peripheral mode;

    2. When VBUS is on while ID pin is grounded, the USB controller goes to host mode.

    (BTY, this is a simplified summary, there are more factors in the USB mode transitions...)

    Since your board has USB0_VBUS permanently tied to 5V, you always run into case 1 when grounding USB0_ID, so USB0 doesn't go to host mode.

  • Hi Bin,

    Thanks for you quick response.

    So your comments actually gave me the idea to reset the processor with USB0_ID grounded and the flash drive already plugged in and powered up. This procedure "works': USB0 enters host mode and can now see and query the flash drive:


    [ 25.628098] usb 1-1: new high-speed USB device number 2 using musb-hdrc
    [ 25.836074] usb 1-1: New USB device found, idVendor=13fe, idProduct=4500, bc0
    [ 25.844399] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 25.853072] usb 1-1: Product: USB DISK 2.0
    [ 25.857193] usb 1-1: SerialNumber: F8289DE3EACBBEB6

    # 8105.chkusb.sh
    chkusb.sh Version 0.3.2
    Linux dto 5.15.0-dirty #9 PREEMPT Wed Aug 21 11:57:02 CDT 2024 armv7l GNU/Linux
    USB is initialized
    Warning: CONFIG_USB_OTG defined.
    musb-hdrc.0: mode a_host, Vbus on, timeout 1100 msec
    /sys/kernel/debug/usb/musb-hdrc.0/regdump:Power : f0
    /sys/kernel/debug/usb/musb-hdrc.0/regdump:Testmode : 00
    /sys/kernel/debug/usb/musb-hdrc.0/regdump:DevCtl : 5d
    musb-hdrc.1: mode a_wait_bcon, Vbus on, timeout 1100 msec
    /sys/kernel/debug/usb/musb-hdrc.1/regdump:Power : e0
    /sys/kernel/debug/usb/musb-hdrc.1/regdump:Testmode : 00
    /sys/kernel/debug/usb/musb-hdrc.1/regdump:DevCtl : 19
    usb@1400: otg, okay
    usb@1800: host, okay
    Device Tree USB node status:
    .: (enabled)
    usb-phy@1300: (enabled)
    usb-phy@1b00: (enabled)
    usb@1400: okay
    usb@1800: okay
    dma-controller@2000: (enabled)

    The gadget driver is built-in
    gadget driver loaded: DRIVER=configfs-gadget


    If I unplug the flash drive, USB0 reverts to peripheral mode and, as I discovered before, cannot be switched (back) to host mode for the reasons you outlined. This is actually OK because the use case for this is a custom setup where both sides of the connection are completely contained, and any concerns you have about being non-compliant should not be an issue.

    That is the good news. The bad news is that system is not "doing" anything with the flash drive. I did not expect it to be mounted, but I thought it would at least show up as /dev/sda or similar. I thought from reading the documentation that host mode would handle mass storage devices by default, but I am wondering, going back to one of my original questions, if I am still missing something from the kernel configuration. The custom system would actually use a different device, and I want to understand what it takes to install the correct drivers for it (assuming they exist), but getting the flash drive to work is a good start.

    Thanks again for your help.

  • Hi Dave,

    Thanks for the update.

    The good news is now the USB controller is doing what we wanted. The log shows if USB0_ID pin is grounded before USB0_VBUS is powered, the USB controller will go into host mode, and the USB device is enumerated.

    The bad news is that system is not "doing" anything with the flash drive. I did not expect it to be mounted, but I thought it would at least show up as /dev/sda or similar.

    Does it behave differently if now you attach the same USB flash drive to the USB1 port which is already in host mode? Does the console log show more messages when the flash drive is attached to USB1 port than to USB0 port?

  • Unfortunately, I cannot attach it to USB1 because it is hardwired to a modem module.

  • Ok, please double check if you have CONFIG_USB_MASS_STORAGE enabled in your kernel .config. I don't see it in the list of your first post above.

  • I had to go back and look: CONFIG_USB_CONFIGFS_MASS_STORAGE is enabled but not CONFIG_USB_MASS_STORAGE. (BTW, even from the descriptions, I am not sure what the difference is.) I enabled it, as well, but it causes a kernel panic:

    [ 2.028814] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [ 2.035139] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regr
    [ 2.043706] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regr
    [ 2.051563] remoteproc remoteproc0: powering up wkup_m3
    [ 2.057829] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf,8
    [ 2.068326] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus numb1
    [ 2.077302] remoteproc remoteproc0: remote processor wkup_m3 is now up
    [ 2.077331] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192
    [ 2.091210] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, b5
    [ 2.099520] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber1
    [ 2.106835] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using ExteA
    [ 2.114636] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using ExteA
    [ 2.122666] usb usb1: Product: MUSB HDRC host driver
    [ 2.128051] usb usb1: Manufacturer: Linux 5.15.0-dirty musb-hcd
    [ 2.134234] usb usb1: SerialNumber: musb-hdrc.0
    [ 2.139540] hub 1-0:1.0: USB hub found
    [ 2.143470] hub 1-0:1.0: 1 port detected
    [ 2.153634] Mass Storage Function, version: 2009/09/11
    [ 2.158812] LUN: removable file: (no medium)
    [ 2.163416] no file given for LUN0
    [ 2.167075] g_mass_storage musb-hdrc.0: failed to start g_mass_storage: -22
    [ 2.174402] 8<--- cut here ---
    [ 2.177501] Unable to handle kernel NULL pointer dereference at virtual addr0
    [ 2.185697] pgd = 72971517
    [ 2.188543] [00000050] *pgd=00000000
    [ 2.192270] Internal error: Oops: 5 [#1] PREEMPT ARM
    [ 2.197260] Modules linked in:
    [ 2.200331] CPU: 0 PID: 53 Comm: kworker/u2:1 Not tainted 5.15.0-dirty #12
    [ 2.207238] Hardware name: Generic AM33XX (Flattened Device Tree)
    [ 2.213356] Workqueue: events_unbound deferred_probe_work_func
    [ 2.219231] PC is at kernfs_find_ns+0x8/0xfc
    [ 2.223532] LR is at kernfs_find_and_get_ns+0x30/0x48
    [ 2.228606] pc : [<c02d33c8>] lr : [<c02d3894>] psr: 40000113
    [ 2.234898] sp : c1795cc4 ip : 00000000 fp : 00000010
    [ 2.240143] r10: 00000000 r9 : 00000000 r8 : 00000000
    [ 2.245386] r7 : 00000000 r6 : c0865adc r5 : 00000000 r4 : c0c79f9c
    [ 2.251940] r3 : c1724d81 r2 : 00000000 r1 : c0865adc r0 : 00000000
    [ 2.258496] Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
    [ 2.265664] Control: 10c5387d Table: 80004019 DAC: 00000051
    [ 2.271430] Register r0 information: NULL pointer
    [ 2.276157] Register r1 information: non-slab/vmalloc memory
    [ 2.281842] Register r2 information: NULL pointer
    [ 2.286565] Register r3 information: slab task_struct start c1724d80 pointer1
    [ 2.294444] Register r4 information: non-slab/vmalloc memory
    [ 2.300128] Register r5 information: NULL pointer
    [ 2.304851] Register r6 information: non-slab/vmalloc memory
    [ 2.310534] Register r7 information: NULL pointer
    [ 2.315257] Register r8 information: NULL pointer
    [ 2.319979] Register r9 information: NULL pointer
    [ 2.324703] Register r10 information: NULL pointer
    [ 2.329513] Register r11 information: zero-size pointer
    [ 2.334759] Register r12 information: NULL pointer
    [ 2.339570] Process kworker/u2:1 (pid: 53, stack limit = 0xd40e74a6)
    [ 2.345953] Stack: (0xc1795cc4 to 0xc1796000)
    [ 2.350333] 5cc0: c0c79f9c 00000000 c0865adc 00000000 c02d3894 c0864
    [ 2.358547] 5ce0: c2050040 c0c03248 00000000 c02d7ea8 c20511b0 c20511f4 c2054
    [ 2.366761] 5d00: c20511b0 c049c858 c09d3490 c0850b8c 00000000 c03fbbf0 c2053
    [ 2.374975] 5d20: c2051170 c20511b0 c2051164 c2050040 c2051040 c0c03248 00000
    [ 2.383188] 5d40: 00000010 c049cbbc ffffffea c0521d18 00000000 000001f4 c2050
    [ 2.391402] 5d60: c2051040 c0d0c380 c2c38140 c0517668 c2c38180 c2050040 00003
    [ 2.399616] 5d80: 00000000 c2bb3a10 00000033 c09e2cf4 c2bb3a00 c2c38140 c0c00
    [ 2.407830] 5da0: 5455d738 382d494d 7964202c 4946206e 2c734f46 6c756220 6f63d
    [ 2.416043] 5dc0: 62202c65 206b6c75 696c7073 48202c74 53492d42 7852204f 4248d
    [ 2.424257] 5de0: 2c785420 666f5320 6e6f4374 0000006e 00000000 00000000 00003
    [ 2.432472] 5e00: 00000000 c2bb3a10 00000000 c0c87a20 c2bb3a10 0000007d c0c98
    [ 2.440685] 5e20: c100e000 c04a4a2c c2bb3a10 00000000 c0c87a20 c04a21b8 c2bbc
    [ 2.448899] 5e40: c2bb3a10 c0c87a20 c1795ee4 c04a2608 00000000 dfa5bfa8 00000
    [ 2.457112] 5e60: c09e5978 c0d0bad8 c0d0badc c1795ee4 c2bb3a10 0000007d c0c98
    [ 2.465326] 5e80: c100e000 c04a2738 00000001 c0c87a20 c1795ee4 c2bb3a10 0000c
    [ 2.473540] 5ea0: 00000000 c1795ee4 c04a2a40 c0c03248 00000001 c04a0180 c100c
    [ 2.481754] 5ec0: c266a1b4 d4931623 c2bb3a10 c0c03248 c2bb3a10 c2bb3a54 c0c80
    [ 2.489967] 5ee0: c2bb3a10 c2bb3a10 00000001 d4931623 c2bde450 c2bb3a10 c0c8c
    [ 2.498181] 5f00: c0c84c18 c04a10e8 c2bde450 c2bb3a10 c0c84c0c c04a1644 c0c80
    [ 2.506396] 5f20: 00000040 c100f000 00000000 c0c84c44 c100f00d c013aefc c1004
    [ 2.514611] 5f40: c17e4d80 c100e000 c17e4d98 ffffe000 c0c72320 c100e014 00004
    [ 2.522825] 5f60: 00000000 c17d1280 c17ddf40 c013b184 c17e4d80 00000000 c1790
    [ 2.531039] 5f80: c17d129c c01425c0 00000000 c17ddf40 c0142428 00000000 00000
    [ 2.539252] 5fa0: 00000000 00000000 00000000 c0100130 00000000 00000000 00000
    [ 2.547465] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000
    [ 2.555679] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000
    [ 2.563898] [<c02d33c8>] (kernfs_find_ns) from [<00000000>] (0x0)
    [ 2.570033] Code: ebffff36 eaffffec e92d40f0 e292c000 (e1d035b0)
    [ 2.576255] ---[ end trace 534c8a1633c33410 ]---
    [ 2.593083] Kernel panic - not syncing: Fatal exception
    [ 2.608457] Rebooting in 3 seconds..

    I tried disabling CONFIG_USB_CONFIGFS_MASS_STORAGE, but got the same result. It does this when the flash drive is plugged with grounded USB0_ID and without it and USB0_ID floating (which should bring it up in peripheral mode and let the device be enumerated as mass storage and ethernet gadgets when plugged into a host).

  • I had to go back and look: CONFIG_USB_CONFIGFS_MASS_STORAGE is enabled but not CONFIG_USB_MASS_STORAGE. (BTW, even from the descriptions, I am not sure what the difference is.) I enabled it, as well, but it causes a kernel panic:

    [ 2.028814] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [ 2.035139] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regr
    [ 2.043706] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regr
    [ 2.051563] remoteproc remoteproc0: powering up wkup_m3
    [ 2.057829] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf,8
    [ 2.068326] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus numb1
    [ 2.077302] remoteproc remoteproc0: remote processor wkup_m3 is now up
    [ 2.077331] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192
    [ 2.091210] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, b5
    [ 2.099520] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber1
    [ 2.106835] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using ExteA
    [ 2.114636] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using ExteA
    [ 2.122666] usb usb1: Product: MUSB HDRC host driver
    [ 2.128051] usb usb1: Manufacturer: Linux 5.15.0-dirty musb-hcd
    [ 2.134234] usb usb1: SerialNumber: musb-hdrc.0
    [ 2.139540] hub 1-0:1.0: USB hub found
    [ 2.143470] hub 1-0:1.0: 1 port detected
    [ 2.153634] Mass Storage Function, version: 2009/09/11
    [ 2.158812] LUN: removable file: (no medium)
    [ 2.163416] no file given for LUN0
    [ 2.167075] g_mass_storage musb-hdrc.0: failed to start g_mass_storage: -22
    [ 2.174402] 8<--- cut here ---
    [ 2.177501] Unable to handle kernel NULL pointer dereference at virtual addr0
    [ 2.185697] pgd = 72971517
    [ 2.188543] [00000050] *pgd=00000000
    [ 2.192270] Internal error: Oops: 5 [#1] PREEMPT ARM
    [ 2.197260] Modules linked in:
    [ 2.200331] CPU: 0 PID: 53 Comm: kworker/u2:1 Not tainted 5.15.0-dirty #12
    [ 2.207238] Hardware name: Generic AM33XX (Flattened Device Tree)
    [ 2.213356] Workqueue: events_unbound deferred_probe_work_func
    [ 2.219231] PC is at kernfs_find_ns+0x8/0xfc
    [ 2.223532] LR is at kernfs_find_and_get_ns+0x30/0x48
    [ 2.228606] pc : [<c02d33c8>] lr : [<c02d3894>] psr: 40000113
    [ 2.234898] sp : c1795cc4 ip : 00000000 fp : 00000010
    [ 2.240143] r10: 00000000 r9 : 00000000 r8 : 00000000
    [ 2.245386] r7 : 00000000 r6 : c0865adc r5 : 00000000 r4 : c0c79f9c
    [ 2.251940] r3 : c1724d81 r2 : 00000000 r1 : c0865adc r0 : 00000000
    [ 2.258496] Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
    [ 2.265664] Control: 10c5387d Table: 80004019 DAC: 00000051
    [ 2.271430] Register r0 information: NULL pointer
    [ 2.276157] Register r1 information: non-slab/vmalloc memory
    [ 2.281842] Register r2 information: NULL pointer
    [ 2.286565] Register r3 information: slab task_struct start c1724d80 pointer1
    [ 2.294444] Register r4 information: non-slab/vmalloc memory
    [ 2.300128] Register r5 information: NULL pointer
    [ 2.304851] Register r6 information: non-slab/vmalloc memory
    [ 2.310534] Register r7 information: NULL pointer
    [ 2.315257] Register r8 information: NULL pointer
    [ 2.319979] Register r9 information: NULL pointer
    [ 2.324703] Register r10 information: NULL pointer
    [ 2.329513] Register r11 information: zero-size pointer
    [ 2.334759] Register r12 information: NULL pointer
    [ 2.339570] Process kworker/u2:1 (pid: 53, stack limit = 0xd40e74a6)
    [ 2.345953] Stack: (0xc1795cc4 to 0xc1796000)
    [ 2.350333] 5cc0: c0c79f9c 00000000 c0865adc 00000000 c02d3894 c0864
    [ 2.358547] 5ce0: c2050040 c0c03248 00000000 c02d7ea8 c20511b0 c20511f4 c2054
    [ 2.366761] 5d00: c20511b0 c049c858 c09d3490 c0850b8c 00000000 c03fbbf0 c2053
    [ 2.374975] 5d20: c2051170 c20511b0 c2051164 c2050040 c2051040 c0c03248 00000
    [ 2.383188] 5d40: 00000010 c049cbbc ffffffea c0521d18 00000000 000001f4 c2050
    [ 2.391402] 5d60: c2051040 c0d0c380 c2c38140 c0517668 c2c38180 c2050040 00003
    [ 2.399616] 5d80: 00000000 c2bb3a10 00000033 c09e2cf4 c2bb3a00 c2c38140 c0c00
    [ 2.407830] 5da0: 5455d738 382d494d 7964202c 4946206e 2c734f46 6c756220 6f63d
    [ 2.416043] 5dc0: 62202c65 206b6c75 696c7073 48202c74 53492d42 7852204f 4248d
    [ 2.424257] 5de0: 2c785420 666f5320 6e6f4374 0000006e 00000000 00000000 00003
    [ 2.432472] 5e00: 00000000 c2bb3a10 00000000 c0c87a20 c2bb3a10 0000007d c0c98
    [ 2.440685] 5e20: c100e000 c04a4a2c c2bb3a10 00000000 c0c87a20 c04a21b8 c2bbc
    [ 2.448899] 5e40: c2bb3a10 c0c87a20 c1795ee4 c04a2608 00000000 dfa5bfa8 00000
    [ 2.457112] 5e60: c09e5978 c0d0bad8 c0d0badc c1795ee4 c2bb3a10 0000007d c0c98
    [ 2.465326] 5e80: c100e000 c04a2738 00000001 c0c87a20 c1795ee4 c2bb3a10 0000c
    [ 2.473540] 5ea0: 00000000 c1795ee4 c04a2a40 c0c03248 00000001 c04a0180 c100c
    [ 2.481754] 5ec0: c266a1b4 d4931623 c2bb3a10 c0c03248 c2bb3a10 c2bb3a54 c0c80
    [ 2.489967] 5ee0: c2bb3a10 c2bb3a10 00000001 d4931623 c2bde450 c2bb3a10 c0c8c
    [ 2.498181] 5f00: c0c84c18 c04a10e8 c2bde450 c2bb3a10 c0c84c0c c04a1644 c0c80
    [ 2.506396] 5f20: 00000040 c100f000 00000000 c0c84c44 c100f00d c013aefc c1004
    [ 2.514611] 5f40: c17e4d80 c100e000 c17e4d98 ffffe000 c0c72320 c100e014 00004
    [ 2.522825] 5f60: 00000000 c17d1280 c17ddf40 c013b184 c17e4d80 00000000 c1790
    [ 2.531039] 5f80: c17d129c c01425c0 00000000 c17ddf40 c0142428 00000000 00000
    [ 2.539252] 5fa0: 00000000 00000000 00000000 c0100130 00000000 00000000 00000
    [ 2.547465] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000
    [ 2.555679] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000
    [ 2.563898] [<c02d33c8>] (kernfs_find_ns) from [<00000000>] (0x0)
    [ 2.570033] Code: ebffff36 eaffffec e92d40f0 e292c000 (e1d035b0)
    [ 2.576255] ---[ end trace 534c8a1633c33410 ]---
    [ 2.593083] Kernel panic - not syncing: Fatal exception
    [ 2.608457] Rebooting in 3 seconds..

    I tried disabling CONFIG_USB_CONFIGFS_MASS_STORAGE, but got the same result. It does this when the flash drive is plugged with grounded USB0_ID and without it and USB0_ID floating (which should bring it up in peripheral mode and let the device be enumerated as mass storage and ethernet gadgets when plugged into a host).

    edited to add: this is what it does when it boots successfully with CONFIG_USB_MASS_STORAGE not enabled, but CONFIG_USB_CONFIGFS_MASS_STORAGE enabled:

    [ 2.018205] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [ 2.024557] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regr
    [ 2.033121] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regr
    [ 2.041099] remoteproc remoteproc0: powering up wkup_m3
    [ 2.047484] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf,8
    [ 2.057508] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus numb1
    [ 2.066324] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, b5
    [ 2.074965] remoteproc remoteproc0: remote processor wkup_m3 is now up
    [ 2.081536] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192
    [ 2.088878] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber1
    [ 2.096220] usb usb1: Product: MUSB HDRC host driver
    [ 2.101254] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using ExteA
    [ 2.109050] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using ExteA
    [ 2.116914] usb usb1: Manufacturer: Linux 5.15.0-dirty musb-hcd
    [ 2.123298] usb usb1: SerialNumber: musb-hdrc.0
    [ 2.128702] hub 1-0:1.0: USB hub found
    [ 2.132633] hub 1-0:1.0: 1 port detected
    [ 2.145807] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [ 2.151500] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus numb2
    [ 2.159160] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, b5
    [ 2.167540] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber1
    [ 2.174906] usb usb2: Product: MUSB HDRC host driver
    [ 2.179932] usb usb2: Manufacturer: Linux 5.15.0-dirty musb-hcd
    [ 2.185911] usb usb2: SerialNumber: musb-hdrc.1
    [ 2.191382] hub 2-0:1.0: USB hub found
    [ 2.195233] hub 2-0:1.0: 1 port detected


  • Hi Dave,

    Unfortunately I am unable to explain what causes the kernel crash. I never saw such issue on AM335x before.

    The only thing I could recommend is to test with TI Processor SDK v9.1 or v8.2 kernel, which have been tested on AM335x. I never tried to run the community kernel 5.15 on AM335x. (In theory, it should be an issue though, as the kernel MUSB driver support is very mature.)

    BTY, CONFIG_USB_CONFIGFS_MASS_STORAGE is for using mass_storage in device mode, which CONFIG_USB_MASS_STORAGE is for using mass_storage in host mode. Both should be irrelevant.

  • Thanks for your help anyway, Bin. I do not know what the remaining issues are for the flash drive. Regardless, your earlier answer about the VBUS/ID signal timing was sufficient to allow me move onto the USB device I was actually interested in, and fortunately that is working.