USB Composite in STM32MP135
Hi
I have the same problem as described in the topic below:
https://community.st.com/t5/stm32-mpus-products/usb-composite-in-stm32mp157c/td-p/142734
I tried the solution from the above link. I see that I can set up several USB gadget devices, like NCM Ethernet + multiple ACM serial. But it doesn't work, e.g. I can set the 'usb0' interface link to 'up' and set the IP address to it, but I can't ping it from my laptop. At the same time, I can ping it when I have ONLY NCM Ethernet (without ACM devices).
The same situation with ACM devices, it works only if I have only one. If I have more than one USB gadget device (at least 2), serial port either is always busy or transfer works only in one side (from device to laptop).
I'm working on STM32MP135 Discovery kit (STM32MP135F-DK) with mickledore yocto provided by ST (https://wiki.st.com/stm32mpu/wiki/STM32MP1_Distribution_Package).
My otg config:
usbotg_hs: usb@49000000 {
compatible = "st,stm32mp15-hsotg", "snps,dwc2";
reg = <0x49000000 0x40000>;
clocks = <&rcc USBO_K>;
clock-names = "otg";
resets = <&rcc USBO_R>;
reset-names = "dwc2";
interrupts-extended = <&exti 44 IRQ_TYPE_LEVEL_HIGH>;
g-rx-fifo-size = <256>;
g-np-tx-fifo-size = <32>;
g-tx-fifo-size = <128 128 128 128 64 32 16 16>;
dr_mode = "otg";
otg-rev = <0x200>;
usb33d-supply = <&scmi_usb33>;
power-domains = <&pd_core>;
wakeup-source;
feature-domains = <&etzpc STM32MP1_ETZPC_OTG_ID>;
status = "disabled";
};
My configfs commands:
$ modprobe libcomposite
$ cd /sys/kernel/config/usb_gadgets
$ mkdir g1 && cd g1
$ echo 0xabcd > idVendor
$ echo 0x1234 > idProduct
$ mkdir strings/0x409
$ echo myserial > strings/0x409/serialnumber
$ echo mymfg > strings/0x409/manufacturer
$ echo myproduct > strings/0x409/product
$ mkdir configs/c.1
$ echo 120 > configs/c.1/MaxPower
$ modprobe usb_f_acm
$ modprobe usb_f_ncm
$ mkdir functions/acm.0
$ mkdir functions/ncm.0
$ ln -s functions/acm.0 configs/c.1
$ ln -s functions/ncm.0 configs/c.1
$ ls /sys/class/udc > UDC
No errors or warnings.
Even when I enable some USB gadget precomposed configurations (like g_cdc or g_multi), it works in the same way - set up without problem but doesn't work.
Any suggestions?
