cancel
Showing results for 
Search instead for 
Did you mean: 

USB Composite not working in STM32MP151C.

rmaki.1
Associate II

I tried to probe g_multi to make sure that USB Composite was available.

modprobe g_multi file=/dev/mmcblk0

The log of the probe is as follows

[  501.458553] using random self ethernet address
[  501.461560] using random host ethernet address
[  501.480605] Mass Storage Function, version: 2009/09/11
[  501.484304] LUN: removable file: (no medium)
[  501.515744] LUN: file: /dev/mmcblk0
[  501.517783] Number of LUNs=1
[  501.560034] usb0: HOST MAC 96:65:3d:8e:f3:8b
[  501.568658] usb0: MAC 26:dd:85:00:0d:0b
[  501.574102] g_multi gadget: Multifunction Composite Gadget
[  501.584802] g_multi gadget: userspace failed to provide iSerialNumber
[  501.589796] g_multi gadget: g_multi ready
[  501.593808] dwc2 49000000.usb-otg: bound driver g_mult

After that, when I connect the usb, the following message appears and I cannot use it.

 [  514.697458] dwc2 49000000.usb-otg: new device is high-speed
[  514.730608] dwc2 49000000.usb-otg: new address 29
[  514.915961] g_multi gadget: high-speed config #1: Multifunction with RNDIS
[  514.921658] dwc2 49000000.usb-otg: dwc2_hsotg_ep_enable: No suitable fifo found
[  514.928685] ------------[ cut here ]------------
[  514.933314] WARNING: CPU: 0 PID: 0 at kernel/dma/mapping.c:337 dma_free_attrs+0xc4/0xc8
[  514.941280] Modules linked in: g_multi spi_stm32 sch_fq_codel ipv6 nf_defrag_ipv6
[  514.948765] CPU: 0 PID: 0 Comm: swapper Not tainted 5.4.56 #1
[  514.954490] Hardware name: STM32 (Device Tree Support)
[  514.959657] [<c010fc28>] (unwind_backtrace) from [<c010d324>] (show_stack+0x10/0x14)
[  514.967372] [<c010d324>] (show_stack) from [<c012214c>] (__warn+0xd0/0xf4)
[  514.974235] [<c012214c>] (__warn) from [<c01224e4>] (warn_slowpath_fmt+0x64/0xc4)
[  514.981709] [<c01224e4>] (warn_slowpath_fmt) from [<c017d7dc>] (dma_free_attrs+0xc4/0xc8)
[  514.989879] [<c017d7dc>] (dma_free_attrs) from [<c017d9f8>] (dmam_free_coherent+0x38/0x9c)
[  514.998140] [<c017d9f8>] (dmam_free_coherent) from [<c07ca380>] (dwc2_hsotg_ep_enable+0x280/0x690)
[  515.007093] [<c07ca380>] (dwc2_hsotg_ep_enable) from [<c081f0b0>] (usb_ep_enable+0x38/0xe0)
[  515.015434] [<c081f0b0>] (usb_ep_enable) from [<c0830cf0>] (gserial_connect+0x3c/0x18c)
[  515.023424] [<c0830cf0>] (gserial_connect) from [<c082d3f8>] (acm_set_alt+0x80/0x170)
[  515.031244] [<c082d3f8>] (acm_set_alt) from [<c081c1b8>] (composite_setup+0x1b70/0x1c7c)
[  515.039329] [<c081c1b8>] (composite_setup) from [<c07cbb44>] (dwc2_hsotg_complete_setup+0x1a4/0x7)
[  515.048457] [<c07cbb44>] (dwc2_hsotg_complete_setup) from [<c07c963c>] (dwc2_hsotg_complete_reque)
[  515.058536] [<c07c963c>] (dwc2_hsotg_complete_request) from [<c07cd0f4>] (dwc2_hsotg_epint+0xbc8/)
[  515.067922] [<c07cd0f4>] (dwc2_hsotg_epint) from [<c07cedcc>] (dwc2_hsotg_irq.part.0+0x8cc/0xf4c)
[  515.076789] [<c07cedcc>] (dwc2_hsotg_irq.part.0) from [<c0164110>] (__handle_irq_event_percpu+0x6)
[  515.086345] [<c0164110>] (__handle_irq_event_percpu) from [<c016432c>] (handle_irq_event_percpu+0)
[  515.095989] [<c016432c>] (handle_irq_event_percpu) from [<c01643d4>] (handle_irq_event+0x4c/0x84)
[  515.104856] [<c01643d4>] (handle_irq_event) from [<c0168628>] (handle_fasteoi_irq+0xc0/0x190)
[  515.113372] [<c0168628>] (handle_fasteoi_irq) from [<c01632b4>] (generic_handle_irq+0x24/0x34)
[  515.121972] [<c01632b4>] (generic_handle_irq) from [<c01639e0>] (__handle_domain_irq+0x70/0xd8)
[  515.130667] [<c01639e0>] (__handle_domain_irq) from [<c0546a70>] (gic_handle_irq+0x4c/0x80)
[  515.139009] [<c0546a70>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0xa8)
[  515.146466] Exception stack(0xc1101f30 to 0xc1101f78)
[  515.151514] 1f20:                                     c0e11d04 00000000 00007e84 c0118760
[  515.159687] 1f40: 00000000 00000000 c1100000 00000000 c11040e4 c1051a38 dfdffdc0 00000000
[  515.167853] 1f60: ffffffff c1101f80 c0109f48 c0109f4c 60030013 ffffffff
[  515.174467] [<c0101a8c>] (__irq_svc) from [<c0109f4c>] (arch_cpu_idle+0x38/0x3c)
[  515.181856] [<c0109f4c>] (arch_cpu_idle) from [<c0150c18>] (do_idle+0x1e8/0x254)
[  515.189240] [<c0150c18>] (do_idle) from [<c0150f74>] (cpu_startup_entry+0xc/0x10)
[  515.196719] [<c0150f74>] (cpu_startup_entry) from [<c1000ef8>] (start_kernel+0x4a4/0x4e0)
[  515.204868] ---[ end trace 208cad574c0cfa6e ]---
[  515.209768] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
[  515.215845] dwc2 49000000.usb-otg: dwc2_hsotg_ep_enable: No suitable fifo found
[  515.256455] g_multi gadget: common->fsg is NULL in fsg_setup at 495

Has anyone been able to get g_multi or USB multi-class composite to work on the STM32MP1?

1 ACCEPTED SOLUTION

Accepted Solutions
rmaki.1
Associate II

Self solved.

There is a g-tx-fifo-size in the device tree of dwc2, and changing this solved the problem.

View solution in original post

1 REPLY 1
rmaki.1
Associate II

Self solved.

There is a g-tx-fifo-size in the device tree of dwc2, and changing this solved the problem.