- WSL 2
- Ubuntu on Windows using WSL (Next section)
- Visual Studio Code
- usbipd-win
If you don't have WSL installed run
wsl --install
Update the WSL kernel with
wsl --update
Check WSL available distributions list with the Powershell
command prompt, as below:
wsl -l -o
You can install Ubuntu as below:
wsl --install --distribution Ubuntu
Make sure to upgrade the distribution to WSL version 2 with:
wsl --set-version Ubuntu 2
Set the distribution as default:
wsl -s Ubuntu
Inside the WSL, Install ESP-IDF requirements for Linux.
sudo apt-get install git wget flex bison gperf python3-pip python3-venv python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util
Install usbipd in Powershell command prompt:
winget install usbipd
Now configure the USB serial device to be able to connect to the WSL with usbipd
:
-
Open PowerShell command prompt with administrator rights and then type in the command
usbipd list
for a list of USB serial devices. -
To access the specify device which is from local Windows on WSL, the user needs to bind this device to WSL. Open PowerShell command prompt with administrator right and then type in the command
usbipd bind -b <BUSID>
:Note: this command only needs to type in only one time,unless the computer has restarted.
-
Attach the specify device to WSL with
usbipd attach --wsl --busid <BUSID>
command. but open the Powershell command prompt with regular user permissions. -
Check if it works well by typing in
dmesg | tail
command on WSL side.as we can see above,1-1 device has been attached to
ttyACM0
, that means WSL can access the 1-1 USB device<BUSID>
from now on.
it means that usbipd
tool has been installed successfully on both side if all commands above can work well.
The user might need to install/update pip in the virtual environment like:
To develop in WSL, install the Remote - WSL and ESP-IDF extensions which are shown below:
Note: Running the setup from WSL could override the Windows host machine configuration settings since it is using the User Settings by default. Consider saving settings to a workspace or workspace folder with the ESP-IDF: Select where to Save Configuration Settings command as described in the working with multiple projects document.
Create an ESP-IDF Project and use ESP-IDF extension features. You can follow the WSL Tutorial for an example.