ESP8266: Setting up Netbeans to compile to the esp8266

A quick post in how to setup Netbeans 8 to be able to program native C/C++ programs for the esp8266. Most of the people use Eclipse, but sorry, I’m a Netbeans guy 🙂

1st) Start up Netbeans and go to the menu Tools->Options

2nd) Select C/C++. You might have to install the C/C++ plugin if you haven’t done it yet or if you don’t have a full installation of Netbeans.
Selection_003

3rd) Select the Add button bellow Tool Collection list, and create a new Compiler tools for the esp8266:

Selection_004

Make sure that Tool Collection Family is GNU and give it a cool name. As we can see the tool directory is where the XTensa compiler tools are installed. Please note that I’ve installed the C++ version of tools that have the C and C++ compiler.

Press Apply.

4th) Add the complete path to the C and C++ compiler:
Selection_005

5th) Check configuration. Press the Versions button to show the current versions of the Xtensa compiler and check out the Code Assistance tab to see that the files are automatically defined:

Selection_006

Press Apply and OK and we are ready.

Example: Importing and compiling esp_mqtt project:

Select File->New Project and choose C/C++ Project with existing sources:

Selection_007

Press Next and select the directory where the project files are. (I’ve already have git “cloned” them).

Selection_008

Just make sure that the Tools collection selected is now the previously defined tool set: ESP8266_XTensa.

The new project will run make clean and make automatically and should compile things just fine:

Selection_009

Success!

Advertisements

2 thoughts on “ESP8266: Setting up Netbeans to compile to the esp8266

  1. Pingback: ESP8266 – Setting up Sming and NetBeans | Primal Cortex's Weblog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s