Skip to content

Latest commit

 

History

History
96 lines (58 loc) · 3.45 KB

WSL.md

File metadata and controls

96 lines (58 loc) · 3.45 KB

Using this Extension on Windows Subsystem for Linux (WSL)

Required tools

  1. WSL 2
  2. Ubuntu on Windows using WSL (Next section)
  3. Visual Studio Code
  4. usbipd-win

Ubuntu on Windows

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

usbipd

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:

  1. Open PowerShell command prompt with administrator rights and then type in the command usbipd list for a list of USB serial devices.

  2. To access the specify device which is from local Windows on WSL, you 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.

  3. Attach the specify device to WSL with usbipd attach --wsl --busid <BUSID> command. but open the Powershell command prompt with regular user permissions.

  4. 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.

You might need to install/update pip in the virtual environment like:

Visual Studio Code

To develop in WSL, install the Remote - WSL and ESP-IDF extensions which are shown below:

Configure the ESP-IDF extension as explained in the Install tutorial or in Setup documentation.

Note: Running the setup from WSL could override the Windows host machine configuration settings since it is using your 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.