在WSL2下使用Vivado工作流
在WSL2下使用Vivado工作流
Background
WSL2 does not support native connection to USB devices on host machine. This blog briefly introduces steps in sharing and connecting devices via usbipd
under WSL2.
Prerequisites
- WSL2
usbipd
installation in Windows.
USB attachment
In Windows powershell with admin previledge, run:
NOTE: attach ALL devices from the board
1
2
3
4
5
6
7
8
# find USB busid
usbipd list
# share devices with WSL2
usbipd bind --busid $(BUS_ID)
# attach to WSL2
usbipd attach --wsl --busid $(BUS_ID)
In WSL2, check attached devices:
1
lsusb
Connect in Vivado
Linux Vivado doesn’t provide cable drivers by default. Therefore, to install the drivers, in WSL2 run:
1
2
cd $XILINX_VIVADO/data/xicom/cable_drivers/lin64/install_script/install_drivers
sudo ./install_drivers
Then, open Vivado with sudo
(?), or modify USB device ownership with usermod
or chmod
. e.g.,
1
chmod -R -777 /dev/bus/usb
As a result of successful executions, one can now connect to the board in Vivado under WSL2.
Group policy
On managed PCs, group policies may block usbipd
from connecting to Windows. To solve this:
- Go to
C:/Windows/System32
. - Run
gpedit.msc
(group policy editor) as admin. - in Computer Configuration > Windows Settings > Security Settings > Windows Defender with Advanced Security > Windows Defender Firewall with … > Inbound rules
- Add a rule to allow TCP at port 3240 at least for
usbipd
. - Rerun
powershell
steps.
This post is licensed under CC BY 4.0 by the author.