C
Coder.com18h ago
Uwe

USBIP Dev Kit Tunnel for Embedded SW Dev

I'm evaluating if I can use a CDE for embedded SW dev. For this, I want to forward a locally connected dev kit into a Coder workspace. Testing with standard STM32F4 eval board connected via USB. So far so good, but right now I'm stuck because I don't know if this is a Coder/USBIP/PICNIC error usbip: error: import device. Does anybody know? Locally installed and run Coder in WSL2 on Windows. USBIP kernel space drivers are included in WSL2 kernel, corresponding user space tools are alternatives:
<username>@STM32exp:~$ uname -r
5.15.167.4-microsoft-standard-WSL2
<username>@STM32exp:~$ sudo apt install linux-tools-virtual hwdata
<username>@STM32exp:~$ sudo update-alternatives --install /usr/local/bin/usbip usbip $(command -v ls /usr/lib/linux-tools/*/usbip | tail -n1) 20
update-alternatives: using /usr/lib/linux-tools/6.8.0-49-generic/usbip to provide /usr/local/bin/usbip (usbip) in auto mode
<username>@STM32exp:~$ uname -r
5.15.167.4-microsoft-standard-WSL2
<username>@STM32exp:~$ sudo apt install linux-tools-virtual hwdata
<username>@STM32exp:~$ sudo update-alternatives --install /usr/local/bin/usbip usbip $(command -v ls /usr/lib/linux-tools/*/usbip | tail -n1) 20
update-alternatives: using /usr/lib/linux-tools/6.8.0-49-generic/usbip to provide /usr/local/bin/usbip (usbip) in auto mode
I'm trying to tunnel USBIP port via ssh.
PS C:\Users\<user>> usbipd.exe list
Connected:
BUSID VID:PID DEVICE STATE
2-1 0483:374b ST-Link Debug, USB Mass Storage Device, USB Serial Device... Shared
PS C:\Program Files\Coder\bin> ssh -R 2001:localhost:3240 coder.STM32exp
<username>@STM32exp:~$ sudo /usr/local/bin/usbip --tcp-port 2001 attach -r localhost -b 2-1
usbip: info: using port 2001 ("2001")
usbip: error: import device
PS C:\Users\<user>> usbipd.exe list
Connected:
BUSID VID:PID DEVICE STATE
2-1 0483:374b ST-Link Debug, USB Mass Storage Device, USB Serial Device... Shared
PS C:\Program Files\Coder\bin> ssh -R 2001:localhost:3240 coder.STM32exp
<username>@STM32exp:~$ sudo /usr/local/bin/usbip --tcp-port 2001 attach -r localhost -b 2-1
usbip: info: using port 2001 ("2001")
usbip: error: import device
Windows activated USBIP debugging:
PS C:\Users\<user>> usbipd.exe server
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Users\<users>
info: Usbipd.ConnectedClient[1]
Client ::1 claimed device at 2-1 (USB\VID_0483&PID_374B\0669FF3537394E3457251423).
info: Usbipd.ConnectedClient[2]
Client ::1 released device at 2-1 (USB\VID_0483&PID_374B\0669FF3537394E3457251423).
PS C:\Users\<user>> usbipd.exe server
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Users\<users>
info: Usbipd.ConnectedClient[1]
Client ::1 claimed device at 2-1 (USB\VID_0483&PID_374B\0669FF3537394E3457251423).
info: Usbipd.ConnectedClient[2]
Client ::1 released device at 2-1 (USB\VID_0483&PID_374B\0669FF3537394E3457251423).
2 Replies
Codercord
Codercord18h ago
<#1308876503370698813>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Uwe
UweOP17h ago
Some addendum:
root@STM32exp:/sys/devices/platform/vhci_hcd.0# /usr/local/bin/usbip --debug --tcp-port 2001 attach -r localhost -b 2-1
usbip: debug: usbip_network.c:28:[usbip_setup_port_number] parsing port arg '2001'
usbip: info: using port 2001 ("2001")
usbip: debug: usbip.c:129:[run_command] running command: `attach'
libusbip: debug: vhci_driver.c:269:[usbip_vhci_driver_open] available ports: 16
libusbip: debug: vhci_driver.c:281:[usbip_vhci_driver_open] available controllers: 1
libusbip: debug: vhci_driver.c:128:[refresh_imported_device_list] controller 0
libusbip: debug: vhci_driver.c:67:[parse_status] hub hs port 0 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
[...]
libusbip: debug: vhci_driver.c:104:[parse_status] exit
usbip: debug: usbip_attach.c:100:[import_device] got free port 0
libusbip: debug: vhci_driver.c:367:[usbip_vhci_attach_device2] writing: 0 3 131073 2
libusbip: debug: vhci_driver.c:372:[usbip_vhci_attach_device2] attach attribute path: /sys/devices/platform/vhci_hcd.0/attach
usbip: debug: sysfs_utils.c:18:[write_sysfs_attribute] error opening attribute /sys/devices/platform/vhci_hcd.0/attach
libusbip: debug: vhci_driver.c:376:[usbip_vhci_attach_device2] write_sysfs_attribute failed
usbip: error: import device
root@STM32exp:/sys/devices/platform/vhci_hcd.0# /usr/local/bin/usbip --debug --tcp-port 2001 attach -r localhost -b 2-1
usbip: debug: usbip_network.c:28:[usbip_setup_port_number] parsing port arg '2001'
usbip: info: using port 2001 ("2001")
usbip: debug: usbip.c:129:[run_command] running command: `attach'
libusbip: debug: vhci_driver.c:269:[usbip_vhci_driver_open] available ports: 16
libusbip: debug: vhci_driver.c:281:[usbip_vhci_driver_open] available controllers: 1
libusbip: debug: vhci_driver.c:128:[refresh_imported_device_list] controller 0
libusbip: debug: vhci_driver.c:67:[parse_status] hub hs port 0 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
[...]
libusbip: debug: vhci_driver.c:104:[parse_status] exit
usbip: debug: usbip_attach.c:100:[import_device] got free port 0
libusbip: debug: vhci_driver.c:367:[usbip_vhci_attach_device2] writing: 0 3 131073 2
libusbip: debug: vhci_driver.c:372:[usbip_vhci_attach_device2] attach attribute path: /sys/devices/platform/vhci_hcd.0/attach
usbip: debug: sysfs_utils.c:18:[write_sysfs_attribute] error opening attribute /sys/devices/platform/vhci_hcd.0/attach
libusbip: debug: vhci_driver.c:376:[usbip_vhci_attach_device2] write_sysfs_attribute failed
usbip: error: import device
I have the feeling this error might not be Coder related but due to a USBIP kernel driver and user space tools version mismatch...
Want results from more Discord servers?
Add your server