Hi Aedan and thanks a lot again. We did finally make it work! Thanks a lot, we followed the approach of the bridge, but used bridge-tools.
To be precise I wrote a bash script that is executed at boot time. It removes the IP address from the USB0 interface, sets up a new bridge br0 under the same IP address and links the USB0 interface to this bridge. So by default we can address the device normally.
Then I wrote a udev rule that checks for new USB connections of the device STM32MP1. If it detects one, it links the new device via its MAC address to br0.
Works like a charm. Again massive kudos for the support!
Apologies I made a mistake there. The command I tried is
ifconfig enxd8de9b838d35 10.42.0.8 up
I verified that the MAC address is of BRK B. The ip address I used is what is configured as a static IP address in BRK B
Hello Aedan and thanks a lot for the thorough explanation. It works! I changed the device tree as you suggested and now. I can see the new gadget in lsusb.
this is the new dmesg output:
[ 1567.864660] usb 2-1: new high-speed USB device number 2 using ehci-platform
[ 1568.173658] rndis_host 2-1:1.0 eth0: register ‘rndis_host’ at usb-5800d000.usbh-ehci-1, RNDIS device, d8:de:9b:83:8d:35
[ 1568.193069] usbcore: registered new interface driver rndis_host
[ 1568.260294] rndis_host 2-1:1.0 enxd8de9b838d35: renamed from eth0
And this is the new lsusb output:
Bus 002 Device 002: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Now I am not sure how to proceed. I followed coloradocarlos suggestion to bring up a new interface using.
ifconfig enxd8de9b838d3510.42.0.7up However when I SSH into that new ip address I am in fact accessing the host BRK A again instead of acessing the peripheral BRK B. Could you kindly provide me a hint how to proceed? Best Benjamin |
Thank you Carlos,
Yes it is a USB Type-A connector.
I do have the same modules enabled as you have (among others of course) and the issue persists.
One interesting lead might be this:
When I connect the BRK to my host PC, this is dmesg from the host:
[21293.581039] usb 1-2: new high-speed USB device number 9 using xhci_hcd
[21293.729697] usb 1-2: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 1.00
[21293.729704] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[21293.729707] usb 1-2: Product: STM32MP1
[21293.729710] usb 1-2: Manufacturer: STMicroelectronics
[21293.729712] usb 1-2: SerialNumber: 002700203239511337383434
[21293.738493] rndis_host 1-2:1.0 eth0: register ‘rndis_host’ at usb-0000:00:14.0-2, RNDIS device, 58:09:4b:39:9a:e7
[21293.803092] rndis_host 1-2:1.0 enx58094b399ae7: renamed from eth0
This is how things should work. The host identifies the USB device and then spins up rndis_host
However, when I connect the peripheral BRK to the host BRK, this is the dmesg from the host BRK:
[ 296.083633] usb 2-1: new high-speed USB device number 2 using ehci-platform
[ 296.285007] usb 2-1: Dual-Role OTG device on non-HNP port
[ 296.289115] usb 2-1: set a_alt_hnp_support failed: -32
[ 296.463623] usb 2-1: new high-speed USB device number 3 using ehci-platform
[ 301.663615] usb 2-1: device descriptor read/64, error -110
[ 317.023670] usb 2-1: device descriptor read/64, error -110
Note the second line ‘Dual-Role OTG device on non-HNP port’…
This makes me belive that before even running rndis, the USB lane on the host (pins USB_DM1 and USB_DP1) does not support HNP and thus can’t identify the peripheral as such.
Now the question would be how to enable HNP for this USB connector.
Do you think restarting usbotg-config on the peripheral would make a change to this HNP problem?
Thank you Carlos,
Yes it is a USB Type-A connector.
I do have the same modules enabled as you have (among others of course) and the issue persists.
One interesting lead might be this:
When I connect the BRK to my host PC, this is dmesg from the host:
[21293.581039] usb 1-2: new high-speed USB device number 9 using xhci_hcd
[21293.729697] usb 1-2: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 1.00
[21293.729704] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[21293.729707] usb 1-2: Product: STM32MP1
[21293.729710] usb 1-2: Manufacturer: STMicroelectronics
[21293.729712] usb 1-2: SerialNumber: 002700203239511337383434
[21293.738493] rndis_host 1-2:1.0 eth0: register ‘rndis_host’ at usb-0000:00:14.0-2, RNDIS device, 58:09:4b:39:9a:e7
[21293.803092] rndis_host 1-2:1.0 enx58094b399ae7: renamed from eth0
This is how things should work. The host identifies the USB device and then spins up rndis_host
However, when I connect the peripheral BRK to the host BRK, this is the dmesg from the host BRK:
[ 296.083633] usb 2-1: new high-speed USB device number 2 using ehci-platform
[ 296.285007] usb 2-1: Dual-Role OTG device on non-HNP port
[ 296.289115] usb 2-1: set a_alt_hnp_support failed: -32
[ 296.463623] usb 2-1: new high-speed USB device number 3 using ehci-platform
[ 301.663615] usb 2-1: device descriptor read/64, error -110
[ 317.023670] usb 2-1: device descriptor read/64, error -110
Note the second line ‘Dual-Role OTG device on non-HNP port’…
This makes me belive that before even running rndis, the USB lane on the host (pins USB_DM1 and USB_DP1) does not support HNP and thus can’t identify the peripheral as such.
Now the question would be how to enable HNP for this USB connector.
Do you think restarting usbotg-config on the peripheral would make a change to this HNP problem?
Regarding the kernel modules: yes I baked them into the kernel directly. I assumed they would still show up in lsmod. Here’s the info you requested. Note that rndis_host is missing from drivers/net/usb.
user@localhost:~$ find /lib/modules/5.10.10/kernel/drivers/usb/gadget -name usb*
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_ncm.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_uac1_legacy.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_hid.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_uvc.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_midi.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_fs.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_rndis.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_ecm_subset.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_uac2.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_printer.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_mass_storage.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_acm.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_serial.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_uac1.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_eem.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_ecm.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_ss_lb.ko
/lib/modules/5.10.10/kernel/drivers/usb/gadget/function/usb_f_obex.ko
user@localhost:~$ find /lib/modules/5.10.10/kernel/drivers/net/usb/
/lib/modules/5.10.10/kernel/drivers/net/usb/
/lib/modules/5.10.10/kernel/drivers/net/usb/lan78xx.ko
/lib/modules/5.10.10/kernel/drivers/net/usb/r8152.ko
Concerning the kernel modules. Yes I baked them into the kernel. Here’s the info you suggested. Note that rndis is missing from the drivers/net/usb directory
Hi coloradocarlos and thanks for the swift response!
so we connect the BRK to the host PC via the regular micro USB connector. Then the BRK has a USB_DM1 and USB_DP1 pin. Together with a GND and +VIN pin we soldered a female USB connector to connect other hardware. It works like a regular USB. I tried connecting other USB devices like cameras before and it worked without a problem. So we don’t need to make use of OTG.
Instead of switching between host and client mode, we want the board to be both at the same time: act as a peripheral to the host PC through its main micro USB connector and act as a host to another BRK through the USB_DM1 abd USB_DP1 pins.
Does that make sense?
Best
Ben
A few notes:
the second BRK (let’s call it BRK B), which I connect to the first one (BRK A), is working for sure, bc I can use it normally when connecting to the host PC. So the issue must be with BRK A’s rndis_host capabilities.
the dmesg errors also show up on BRK B when I connect a it the other way around. (PC -> BRK B -> BRK A). So they seem to be independent of the rndis_host kernel module.
Any help would be greatly appreciated.
Thanks!
Octavo Systems LLC all rights reserved
OCTAVO is registered in the U.S. Patent and Trademark Office. OSD, C-SiP, and the Octavo Logo are trademarks of Octavo Systems LLC.
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields