ESP32 With Eclipse IDE




Introduction: ESP32 With Eclipse IDE

About: I'm busy building machines.

Hello world! In this instructable, we will be looking at how we could develop applications for the ESP32 devkit using the Eclipse IDE (the latest version is Eclipse Oxygen as of December 2017), and the supporting toolchains from Espressif - the makers of ESP32. We will be installing the toolchains, the ESP-IDF from Espressif and finally Eclipse itself. We would then go through some tweaks that would enable us to build and flash applications from Eclipse without the need for external commands. Let's get started.

The ESP32 integrates Wi-Fi and Bluetooth on a single chip, along with dual high-performance cores, ultra-low power co-processor and several peripherals that make it a very robust chip as compared to the ESP8266. You can develop applications for the ESP32 using the Arduino IDE or the Eclipse IDE. This instructable is concerned with the later. I am on a Windows host and some of the steps might be different if you are on Linux or Mac operating system. To get started, let's install the necessary toolchains.

Step 1: Dowload and Install the Toolchain

Click on this link to download the toolchain for Windows. After you have downloaded the zip file, unzip the file to C:\ and it will create a msys32 directory with a pre-prepared environment. Make sure the folder you have extracted is msys32 and not the unzipped zip file (which contains the msys32 folder). If you are on Windows and clicked on "Extract All..." after right-clicking, open up the folder and you will find the msys32 folder. Move this folder to the C:\ directory.

Now check if you have successfully downloaded and installed the toolchain by running C:\msys32\mingw32.exe. This opens an MSYS2 MINGW32 terminal window. The environment in this window is a bash shell that we can use to issue commands. Now we need to get ESP-IDF from GitHub.

Step 2: Get ESP-IDF

Now that we have installed the toolchain (that contains programs to compile and build the application), we also need ESP32 specific API/libraries. They are provided by Espressif in the ESP-IDF GitHub repository. To get it, open the MSYS2 MINGW32 terminal by running C:\msys32\mingw32.exe. Then create a folder named esp by typing the following command.

mkdir esp

Then go into the esp directory and clone the ESP-IDF repository,

cd esp 
git clone --recursive

ESP-IDF will be downloaded into ~/esp/esp-idf after you have issued this command. Now, we need to setup path to ESP-IDF so that our toolchain programs can access it.

Step 3: Setup Path to ESP-IDF

The toolchain programs that we downloaded and installed access ESP-IDF using the IDF_PATH environment variable. This variable should be set up on your PC, otherwise, projects will not build. The setting may be done manually, each time PC is rebooted or permanently by defining IDF_PATH in the user profile. The user profile scripts are contained in C:/msys32/etc/profile.d/ folder. They are executed every time you open an MSYS2 window. We first create a new script file in the C:/msys32/etc/profile.d/ directory and name it To do this, open the MSYS2 MINGW32 terminal by running C:\msys32\mingw32.exe and issue the following commands.

cd esp
cd esp-idf
cd /etc/profile.d/

To create a file and edit it, we use Vim.


Once inside Vim in the terminal, type "i" (without the quotation marks) to enter WRITE/INSERT mode. Now insert the path to ESP-IDF to the IDF_PATH environment variable by typing the following in the terminal text editor.

export IDF_PATH="C:/msys32/home/{your-user-name}/esp/esp-idf"

replace {your-user-name} with your username. To save and exit the in-terminal editor, press the ESC (escape) key and type ":wq" (without the quotation marks). Now close and reopen the MSYS2 terminal and issue the following command.

printenv IDF_PATH

Issuing the command prints out C:/msys32/home/{your-user-name}/esp/esp-idf on the terminal.

Step 4: Establish Serial Connection With the ESP32

To establish a serial connection with the ESP, connect the ESP32 devkit to your computer using a USB to micro-USB cable. Then open device manager by right-clicking the start button on the Windows taskbar. Scroll down and search for the label named Ports. You should see the ESP connected to your host. Note down the port the ESP is connected to. If you have a hard time figuring out which port the ESP is connected to, you may unplug devices that are connected to your host 's USB port and note the last one standing, that should be your ESP.

Now open PuTTY, and click on Serial, which is under the Connection label. Type in the port the ESP is connected to and change the baud rate to 115200. Now click on the Session label (first label from the top) and change the connection type to Serial. Hit Open and you should see log display by the ESP32. The log contents depend on application loaded to ESP32. As long as you see anything legible on the log display you should be good to go.

Step 5: Install Eclipse

Download Eclipse and install it. While the Eclipse installer is running, choose the "Eclipse IDE for C/C++ Developers" option and proceed.

Step 6: Create a Workspace and Import a Project

All projects that are developed for ESP32 using Eclipse need to follow the ESP-IDF template. Before we can use Eclipse, open up the MSYS2 terminal and type the following commands.

cd "C:\Users\{your-user-name}\Desktop"
mkdir workspace
cd workspace
git clone HelloWorld

Now, we need to configure the SDK settings using the following command.

cd HelloWorld
make menuconfig

You will see a menu where you can configure your SDK settings. Select Serial flasher config and then select the Default serial port label. Then enter the name of the port your ESP is connected to. Mine is COM5. Save and exit from the menu.

Step 7: Setting Up Eclipse

Now launch Eclipse. Select the workspace directory that we created earlier as our Eclipse workspace. Then choose File -> Import. In the dialog that pops-up, choose “C/C++” -> “Existing Code as Makefile Project” and click Next. On the next page, enter “Existing Code Location” to be the directory of your project that you cloned from GitHub. The project name should be the same as the directory name of the template that we cloned. On the same page, under “Toolchain for Indexer Settings” uncheck “Show only available toolchains that support this platform”. Then in the extended list that appears, choose “Cygwin GCC”. Then click Finish. You might get warnings but it is completely normal.

The new project will appear under Project Explorer. Right-click the project and choose Properties from the context menu. Click on the “C/C++ Build” properties page (top-level option), uncheck “Use default build command” and enter the following custom build command:

python ${IDF_PATH}/tools/windows/

Click on the “Environment” properties page under “C/C++ Build”: Click “Add” and enter, name: BATCH_BUILD and value: 1. Click “Add” again, and enter, name: IDF_PATH. To obtain the value of IDF_PATH, open the MSYS2 terminal and enter the following command:

echo $IDF_PATH

Copy the path and paste it into the value field. Edit the PATH environment variable. Delete the existing value and replace it with,


Now click Apply. Click on “C/C++ General” -> “Preprocessor Include Paths, Macros, etc.” property page. Click the “Providers” tab, then in the list of providers, click “CDT GCC Built-in Compiler Settings Cygwin”. Under “Command to get compiler specs”, replace the text with the following,

xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"

In the list of providers, click “CDT GCC Build Output Parser” and replace the text in compiler command pattern with the following,


Now the Eclipse IDE is all set and we can now code and build from the IDE.

Step 8: Building and Flashing From Eclipse

Before we build and flash our program from eclipse, copy and paste this "Hello World!" code into the main.c file.

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"

void app_main()
    printf("Hello world!\n");
    /* Print chip information */
    esp_chip_info_t chip_info;
    printf("This is ESP32 chip with %d CPU cores, WiFi%s%s, ",
            (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
            (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
    printf("silicon revision %d, ", chip_info.revision);
    printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
            (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
    for (int i = 10; i >= 0; i--) {
        printf("Restarting in %d seconds...\n", i);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    printf("Restarting now.\n");

Hit Ctrl + S to save. Now right-click the project in the project explorer and click on "Build Targets" -> "Create". In the pop-up window type "flash" as the Target name and click ok. Now click on "Build Targets" in the project explorer and right-click "flash". Select "Build Target".

Hold the RESET button first followed by the BOOT button. No release the RESET button followed by the BOOT button.

Step 9: Results

Now to view the results, open the MSYS2 terminal and issue the following commands.

cd "C:/Users/{user-name}/Desktop"
cd workspace
cd HelloWorld
make monitor

And *boom* you should see the output as shown in the image. Good luck building something awesome!

Arduino Contest 2017

Participated in the
Arduino Contest 2017

Be the First to Share


    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest



    3 months ago

    I get as far as step 6, but when I enter "make menuconfig", I get this:

    SUESYLBRAD@SUE-LAPTOP MINGW32 /c/Users/SUESYLBRAD/Desktop/workspace/Helloworld

    $ make menuconfig
    Makefile:8: C:/msys32/home/SUESYLBRAD/esp/esp-idf/make/ No such file or directory
    make: *** No rule to make target 'C:/msys32/home/SUESYLBRAD/esp/esp-idf/make/'. Stop.

    SUESYLBRAD@SUE-LAPTOP MINGW32 /c/Users/SUESYLBRAD/Desktop/workspace/Helloworld

    There is no directory "make" within "C:/msys32/home/SUESYLBRAD/esp/esp-idf/". What is supposed to have created this directory and its contents?

    I am running Windows 10 64-bit.

    What am I doing wrong? How do I configure Eclipse properly?

    Thank you - Rowan (


    Question 4 months ago on Step 6


    I have reached step 6 and get the following error:

    IAN@DESKTOP-MAINPC MINGW32 /c/USers/IAN/Desktop/workspace/HelloWorld
    $ make menuconfig
    The following Python requirements are not satisfied:
    esp-windows-curses; sys_platform == 'win32'
    The recommended way to install a packages is via "pacman". Please run "pacman -Ss " for searching the package database and if found then "pacman -S mingw-w64-i686-python-" for installing it.
    NOTE: You may need to run "pacman -Syu" if your package database is older and run twice if the previous run updated "pacman" itself.
    Please read for further information about using "pacman"
    WARNING: The cryptography package have dependencies on system packages so please make sure you run "pacman -Syu" followed by "pacman -S mingw-w64-i686-python2-cryptography".
    Diagnostic information:
    IDF_PYTHON_ENV_PATH: (not set)
    Python interpreter used: C:/msys32/mingw32/bin/python.exe
    Warning: python interpreter not running from IDF_PYTHON_ENV_PATH
    PATH: C:\msys32\mingw32\bin;C:\msys32\mingw32\bin;C:\msys32\usr\local\bin;C:\msys32\usr\bin;C:\msys32\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\msys32\opt\xtensa-esp32-elf\bin;C:\msys32\usr\bin\site_perl;C:\msys32\usr\bin\vendor_perl;C:\msys32\usr\bin\core_perl
    make: *** No rule to make target 'check_python_dependencies', needed by 'menuconfig'. Stop.

    I would be very grateful if someone could point me in the right direction.

    I am running Windows 10 on a '64' machine


    PS Is it because the Python 2.7.14 is installed?


    Answer 4 months ago

    I have exactly the same problem and would be happy for a solution!
    Thanks in advance


    Question 6 months ago

    i have issue with this procedure. I followed all as it says. but i am getting build error and stops.
    PLease check screenshot. And please help me on this.


    Question 1 year ago

    With the step "make menuconfig" i get a error:
    $ make menuconfig
    c:/msys32/home/mikev/esp/esp-idf/make/ esp-idf build system only s upports MSYS2 in "MINGW32" mode. Consult the ESP-IDF documentation for details.
    /usr/bin/env: ‘python’: No such file or directory
    make: *** No rule to make target 'check_python_dependencies', needed by 'menucon fig'. Stop.

    I'm missing /usr/bin/env: python
    Anybody knows what i have to do?


    Answer 12 months ago

    dude , did u find it?


    1 year ago on Step 9

    doesn't work. "printenv IDF_PATH"doesn't do anything. tried multiple times but vim "" window just makes windows error sounds and when I try to close it says its doing soothing and do I want to abort.


    Question 1 year ago

    Hi Ad!
    I have a problem like below! please help me!!!


    Question 1 year ago on Step 3


    First of all, thanks for a nice instruction.

    In the step 3, the command line is quite confuse. It should be:

    cd msys32/etc/profile.d


    cd esp

    cd esp-idf

    cd /etc/profile.d/

    Is it correct?

    Thanks in advance!


    2 years ago

    I have setup msys32 and eclipse. when i build the target i get the following error:

    make: *** [C:/msys32/home/huwi/esp/esp-idf/make/ check_python_dependencies] Error 1



    2 years ago on Step 9

    nicely written tutorial, thanks


    Question 2 years ago on Step 8

    I had followed the above process for burning the program over esp32 module. But I'm facing an error while flashing the code using Eclipse IDE.

    The error is :

    21:08:37 **** Build of configuration Default for project HelloWorld ****

    python C:/msys32/home/Prafull/esp/esp-idf/tools/windows/ flash

    make: *** No rule to make target 'flash'. Stop.

    Running make in 'C:/Users/Prafull/Desktop/workspace/HelloWorld/main'

    21:08:37 Build Finished (took 654ms)

    I need someone to help me out please.


    Answer 2 years ago

    The 'Build Targets' / 'flash' object needs to show in the 'root' of the project not under main.


    Question 2 years ago

    I have done all by the HowTo, but getting the Errormessage on "make menuconfig" Target-Pattern does not contain "%". Finish

    Thomas.Henninges@Hal MINGW32 /c/Users/Thomas Henninges/Desktop/workspace/HelloWorld
    $ make menuconfig
    /c/Users/Thomas:1: *** Ziel-Muster enthält kein „%“. Schluss.

    What am I doing wrong ? Sry 4 the stupid question :-}


    Question 2 years ago

    I try to insatll ESP IDF like you write above, but then I try to build project under Eclipse I have next log:

    19:17:03 **** Build of configuration Default for project HelloWorld ****
    python "C:\\msys32\\home\\sleo\\esp\\esp-idf" C:/msys32/home/sleo/esp/esp-idf/tools/windows/ flash
    C:/msys32/mingw32/bin/python.exe: can't find '__main__' module in 'C:\\msys32\\home\\sleo\\esp\\esp-idf'

    19:17:03 Build Finished (took 260ms)

    Without Eclipse I can build, flash and run demo program (I use this manual:

    Can you recomend something to help me? If possible - send replay to e-mail

    Best regards - Leonid.


    Question 2 years ago on Introduction

    hi, i want to develop bluetooth to wifi gateway...esp32 is good for that ?? thank u