https://www.vultr.com

The Everywhere Cloud

Deploy an instance.
Accelerate your application.


Developing ESP8266 with Eclipse on Linux


The following procedure shows how to build ESP8266 microcontroller projects with the Eclipse Integrated Development Environment on Debian-based Linux distributions.

==========

1. INSTALLATION

1.1. Install Espressif's IoT Development Framework for ESP8266 with the RTOS SDK.

1.2. Download and install the Eclipse IDE.

2. PREPARATION

2.1. On the Eclipse IDE, click on the following to open the target ESP8266 project folder and choose its toolchain.

[ File -> Import... ]
[ C/C++ -> Existing Code as Makefile Project -> Next ]
[ Existing Code Location -> Browse... ]
Example: ~/esp/ESP8266_RTOS_SDK/examples/get-started/hello_world
[ Toolchain for Indexer Settings -> Cross GCC -> Finish ]

2.2. Set up the project's properties.

[ Project Explorer tab -> Right-click on project name -> Properties ]

2.2.1. C/C++ General Indexer

Go to [ C/C++ General dropdown -> Indexer ].
Check [ Enable project specific settings ].
Uncheck [ Allow heuristic resolution of includes ].
Click [ Apply ].

2.2.2. C/C++ General Preprocessor Include Paths, Macros etc.

Go to [ C/C++ General dropdown -> Preprocessor Include Paths... -> Providers tab ].
Replace the parameters below with the following values.

[ CDT GCC Build Output Parser -> Compiler command pattern ]:
xtensa-lx106-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)

[ CDT Cross GCC Built-in Compiler Settings -> Command to get compiler specs ]:
xtensa-lx106-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"

Click [ Apply ].

2.2.3. C/C++ Build Settings

Go to [ C/C++ Build panel -> Behavior tab - > Build settings ].
Check [ Enable parallel build ].
Choose [ Use optimal jobs ].
Click [ Apply ].

2.2.4. Open a Linux terminal and execute the following commands to show the ESP8266 IDF toolchain on the shell path. The path needs to be copied and pasted to the Eclipse IDE for its build environment.

user@host: $ source ~/esp/ESP8266_RTOS_SDK/export.sh
user@host: $ echo $PATH

2.2.5. C/C++ Build Environment

Go to [ C/C++ Build dropdown -> Environment panel -> Edit... (or) Add... ].

Name: PATH
Value: Replace with the output of [ echo $PATH ] in the previous step.
Click [ OK ].

Name: BATCH_BUILD
Value: 1
Click [ OK ].

Name: IDF_PATH
Value: ~/esp/ESP8266_RTOS_SDK
Click [ OK ].

Click [Apply].

3. UTILIZATION

3.1. On the Linux terminal, change directory to the target ESP8266 project folder and configure the IDF settings for the project.

user@host: $ cd ~/esp/ESP8266_RTOS_SDK/examples/get-started/hello_world
user@host: $ make menuconfig

3.1.1. Use the arrow keys to highlight menu items.
3.1.2. Choose [ Save ] to accept the current settings.
3.1.3. Choose [ Exit ] to leave the menu.

3.2. Remove old build files, if any.

[ Project Explorer tab -> Right-click on project name -> Clean Project ]

3.3. Build the ESP8266 project binaries.

[ Project Explorer tab -> Right-click on project name -> Build Project ]

3.4. Flash the binaries to the ESP8266 microcontroller.

[ Project Explorer tab -> Right-click on project name -> Build Targets -> Create... ]
Input [ Target name: flash -> Other settings as is -> OK ].
[ Project Explorer tab -> Right-click on project name -> Build Targets -> Build... ]
Choose [ Target: flash -> Build ].

==========

REFERENCES

1. Espressif Systems. ESP8266 RTOS SDK Programming Guide. Build and Flash with Eclipse IDE. https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/eclipse-setup.html

==========

Comments

Popular posts from this blog

Enabling HTTPS in Home Assistant

Configuring the FreeBSD Firewall with IPFW

Running Home Assistant on FreeBSD Servers