• windows usbip(瑞芯微windows开发)


    Rockchip RK3588 windows开发

    安装usbipd

    除usbipd之外,还有一个usbip仓库可以参考usbip-win,但是相对麻烦一些

    windows install
    winget install usbipd
    
    • 1
    Share Devices
    usbipd --help
    usbipd list
    usbipd bind --busid=
    
    • 1
    • 2
    • 3
    Remote Connecting Devices
    > usbip list --remote=<HOST>
    > usbip list -r 172.16.5.111 (例子)
    
    Exportable USB devices
    ======================
     - 172.16.5.111
            1-9: Fuzhou Rockchip Electronics Company : unknown product (2207:0006)
               : USB\VID_2207&PID_0006\5&17411534&0&9
               : (Defined at Interface level) (00/00/00)
               :  0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/42/01)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    > sudo usbip attach --remote= --busid=
    报错
    libusbip: error: udev_device_new_from_subsystem_sysname failed
    usbip: error: open vhci_driver
    
    • 1
    • 2
    • 3
    • 4

    检查 vhci_hcd 模块: 确保 vhci_hcd 模块已加载

    lsmod | grep vhci_hcd
    sudo modprobe vhci_hcd
    
    • 1
    • 2
    wsl2(注意升级wsl2版本)

    windows上运行

    wsl --update
    
    • 1

    wsl2内运行

    sudo apt install linux-tools-virtual hwdata
    sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20
    
    • 1
    • 2

    注意:下面的代码是运行在windows上,而不是wsl2上

    usbipd wsl --help
    usbipd wsl list
    usbipd wsl attach --busid=
    
    • 1
    • 2
    • 3
    • 绑定报错
    usbipd wsl attach --busid 1-9
    
    报错:
    usbipd: info: Using default WSL distribution 'Ubuntu-20.04'; specify the '--distribution' option to select a different one.
    usbip: error: Attach Request for 1-9 failed - Device busy (exported)
    
    usbipd: error: Failed to attach device with busid '1-9'.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 关闭windows上adb.exe
    adb kill-server
    
    • 1
    • 取消绑定
    usbipd wsl detach --busid 1-9
    
    • 1

    wsl2中运行,可发现设备

    lsusb
    
    • 1

    在这里插入图片描述

    adb支持

    要注意的是必须使用sudo命令才能显示出设备

    > adb devices
    * daemon not running; starting now at tcp:5037
    * daemon started successfully
    List of devices attached
    
    > adb kill-server
    
    > sudo adb devices
    * daemon not running; starting now at tcp:5037
    * daemon started successfully
    List of devices attached
    5950907f        device
    
    > adb devices
    List of devices attached
    5950907f        device
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
  • 相关阅读:
    linux命令之printf
    VS Code 远程连接 Jupyter
    如何调试 shell 脚本调试
    c语言学习5==TCP和socket
    Go - 基本数据类型和其字符串表示之间转换
    ArrayLis集合扩容机制
    Redis(四)
    HTML5的新属性
    MySQL高可用和主从同步
    CLIP(Contrastive Language-Image Pre-Training)简介
  • 原文地址:https://blog.csdn.net/qq_39280836/article/details/134437093