If you haven’t already heard for WSL2 (Windows Subsystem for Linux) that is a great feature of Windows that lets us to run Linux OS directly on Windows like any other application, without the overhead of a traditional virtual machine or dualboot setup.
WSL2 becomes very helpful especially for the developers but not so much for developers of embedded devices because WSL2 natively does not support USB devices.
As I personally love to develop applications for ESP32 and ESP8266 chips I was disappointed with the fact that even if I can use WSL2 for building ESP-IDF applications I will not be able to flash them to the devices over the USB port.
Fortunately with a little bit of research how WSL2 works I got Idea how to make this tool that will give me ability to flash my applications into ESP devices. Name of this tool is
idfx and it is published as a open source project on my GitHub profile. Tool is nothing else but one shell script that represents wrapper around idf.py build script.
Supported ESP-IDF versions
idfx, execute the next command inside of WSL2:
curl https://git.io/JyBgj --create-dirs -L -o $HOME/bin/idfx && chmod u+x $HOME/bin/idfx
Previous command will download
idfx shell script and give it executable permissions.
idfx command looks like this:
idfx COMMAND [PORT]
[PORT] is serial COM Port on the Windows (use the Device Manager to find your port), for example COM6, and
COMMAND can be:
For the full list of supported commands please execute next command:
ESP-IDF on WSL2 tutorial
If you are interested in full tutorial about how to setup ESP-IDF and how to build, flash and monitor your ESP applications on WSL2, here is a post exactly about that.