idfx – Tool for flashing ESP-IDF apps on WSL2

idfx

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.

Tool is tested on Ubuntu 20.04 LTS, Ubuntu 22.04 LTS and Debian distributions and only prerequisite for using this tool is that Python needs to be installed on the Windows.

Supported ESP-IDF versions

idfx supports:

Installation

To install 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.

Usage

Signature of idfx command looks like this:

idfx COMMAND [PORT]

Where [PORT] is serial COM Port on the Windows (use the Device Manager to find your port), for example COM6, and COMMAND can be: build, flash, monitor

For the full list of supported commands please execute next command:

idfx help

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.

Preview

GitHub repository

abobija/idfx

2 thoughts on “idfx – Tool for flashing ESP-IDF apps on WSL2

  1. Hi Alioja,
    Thank you for sharing this with the community. Do you have a method for flashing with idfx or other from within a docker container?

    Thak you,
    Joe

Leave a Reply

Your email address will not be published. Required fields are marked *