ESP IDF : Setting up eclipse for ESP 32

In the previous blog we have see how to setup arduino to work with esp32, that was fairly easy, in this blog we will see how to setup eclipse to work with the esp32…compared to arduino this is a bit complicated.

To develope apps with ESP IDF, we need get the toolchain first, you can download preconfigured MSYS2 from here . Extract the zip to C drive

run mingw32.exe 

now we can clone the IDF git repo (you can ignore any errors that are printed on console)

git clone --recursive https://github.com/espressif/esp-idf.git

 

once the command completes, IDF will be available in esp-idf folder

we can turn to eclipse now, you can get eclipse from here . Download appropriate version for your platform.

launch eclipse, we will import a example project from IDF

goto File->Import -> Existing Code as MakeFile Project

 

Give a name and select CrossGCC as toolchain

 

Wait until project is imported, once import completes right click on the project and select properties.

In Build environment add the new variables (marked in the screenshot)

V : 1

IDF_PATH : C:/msys32/home/{user-name}/esp-idf

PATH : C:\msys32\usr\bin;C:\msys32\mingw32\bin;C:\msys32\opt\xtensa-esp32-elf\bin

click on Apply button once you made the changes

Select C/C++ Build , in Builder Settings uncheck “Use default build command”

copy the following in the command box

bash ${IDF_PATH}/tools/windows/eclipse_make.sh

Click on apply button and select C/C++ General tab, we need to change couple commands here

make the following change in Compiler Settings

In Output Parser add xtensa-esp32-elf- at the beginning of the line

now click on apply again ,then click on Ok button

now we can build the project

 

To Flash the compiled code to the dev board, we need define a target

Select Build Target on right side of the IDE, right click on the project, select new

 

provide target name as flash and click ok

Before we can flash we need set our serial port details

Goback to mingw console and navigate to

/home/{user-name}/esp-idf/examples/get-started/hello_world

export IDF_PATH then run make command

 

you will get blue screen like the following

 

 

the final settings should look the following

 

You can start flashing by right clicking on the flash and selecting Build Target

You can see the log in console

 

if you want see the hello world! in serial run make monitor in mingw console

Eclipse might show errors saying that it can’t find the include files, nevertheless the build will succeed.  You can get rid of this errors by adding the include folders manually

Properties -> C/C++ General -> Path and Symbols -> GNU C

 

 

10 Comments

Add a Comment

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