|
|
@@ -1,6 +1,8 @@
|
|
|
Build and Flash with Eclipse IDE
|
|
|
********************************
|
|
|
|
|
|
+.. _eclipse-install-steps:
|
|
|
+
|
|
|
Installing Eclipse IDE
|
|
|
======================
|
|
|
|
|
|
@@ -8,10 +10,17 @@ The Eclipse IDE gives you a graphical integrated development environment for wri
|
|
|
|
|
|
* Start by installing the esp-idf for your platform (see files in this directory with steps for Windows, OS X, Linux).
|
|
|
|
|
|
+* We suggest building a project from the command line first, to get a feel for how that process works. You also need to use the command line to configure your esp-idf project (via ``make menuconfig``), this is not currently supported inside Eclipse.
|
|
|
+
|
|
|
* Download the Eclipse Installer for your platform from eclipse.org_.
|
|
|
|
|
|
* When running the Eclipse Installer, choose "Eclipse for C/C++ Development" (in other places you'll see this referred to as CDT.)
|
|
|
|
|
|
+Windows Users
|
|
|
+=============
|
|
|
+
|
|
|
+Using ESP-IDF with Eclipse on Windows requires different configuration steps. :ref:`See the Eclipse IDE on Windows guide <eclipse-windows-setup>`.
|
|
|
+
|
|
|
Setting up Eclipse
|
|
|
==================
|
|
|
|
|
|
@@ -20,13 +29,13 @@ Once your new Eclipse installation launches, follow these steps:
|
|
|
Import New Project
|
|
|
------------------
|
|
|
|
|
|
-* Eclipse makes use of the Makefile support in ESP-IDF. This means you need to start by creating an ESP-IDF project. You can use the skeleton project from github.
|
|
|
+* Eclipse makes use of the Makefile support in ESP-IDF. This means you need to start by creating an ESP-IDF project. You can use the idf-template project from github, or open one of the examples in the esp-idf examples subdirectory.
|
|
|
|
|
|
* Once Eclipse is running, 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 IDF project. Don't specify the path to the ESP-IDF directory itself.
|
|
|
+* On the next page, enter "Existing Code Location" to be the directory of your IDF project. Don't specify the path to the ESP-IDF directory itself (that comes later). The directory you specify should contain a file named "Makefile" (the project Makefile).
|
|
|
|
|
|
* On the same page, under "Toolchain for Indexer Settings" choose "Cross GCC". Then click Finish.
|
|
|
|
|
|
@@ -38,13 +47,7 @@ Project Properties
|
|
|
|
|
|
* Click on the "Environment" properties page under "C/C++ Build". Click "Add..." and enter name ``V`` and value ``1``.
|
|
|
|
|
|
-* Click "Add..." again, and enter name ``IDF_PATH``. The value should be the full path where ESP-IDF is installed. *Windows users: Use forward-slashes not backslashes for this path, ie C:/Users/MyUser/Development/esp-idf*.
|
|
|
-
|
|
|
-*Windows users only, follow these two additional steps:*
|
|
|
-
|
|
|
-* On the same Environment property page, edit the PATH environment variable. Delete the existing value and replace it with ``C:\msys32\usr\bin;C:\msys32\mingw32\bin;C:\msys32\opt\xtensa-esp32-elf\bin`` (If you installed msys32 to a different directory then you'll need to change these paths to match).
|
|
|
-
|
|
|
-* Click on the "C/C++ Build" top-level properties page then uncheck "Use default build command" and enter this for the custom build command: ``bash ${IDF_PATH}/tools/windows/eclipse_make.sh``.
|
|
|
+* Click "Add..." again, and enter name ``IDF_PATH``. The value should be the full path where ESP-IDF is installed.
|
|
|
|
|
|
*All users, continue with these steps:*
|
|
|
|
|
|
@@ -56,7 +59,22 @@ Navigate to "C/C++ General" -> "Preprocessor Include Paths" property page:
|
|
|
|
|
|
* In the list of providers, click "CDT GCC Build Output Parser" and type ``xtensa-esp32-elf-`` at the beginning of the Compiler command pattern. This means the full Compiler command pattern should be ``xtensa-esp32-elf-(g?cc)|([gc]\+\+)|(clang)``
|
|
|
|
|
|
-* Click OK to close the Properties dialog, and choose Project -> Build to build your project.
|
|
|
+.. _eclipse-build-project:
|
|
|
+
|
|
|
+Building in Eclipse
|
|
|
+-------------------
|
|
|
+
|
|
|
+Before your project is first built, Eclipse may show a lot of errors and warnings about undefined values. This is because some source files are automatically generated as part of the esp-idf build process. These errors and warnings will go away after you build the project.
|
|
|
+
|
|
|
+* Click OK to close the Properties dialog in Eclipse.
|
|
|
+
|
|
|
+* Outside Eclipse, open a command line prompt. Navigate to your project directory, and run ``make menuconfig`` to configure your project's esp-idf settings. This step currently has to be run outside Eclipse.
|
|
|
+
|
|
|
+*If you try to build without running a configuration step first, esp-idf will prompt for configuration on the command line - but Eclipse is not able to deal with this, so the build will hang or fail.*
|
|
|
+
|
|
|
+* Back in Eclipse, choose Project -> Build to build your project.
|
|
|
+
|
|
|
+**TIP**: If your project had already been built outside Eclipse, you may need to do a Project -> Clean before chosing Project -> Build. This is so Eclipse can see the compiler arguments for all source files. It uses these to determine the header include paths.
|
|
|
|
|
|
Flash from Eclipse
|
|
|
------------------
|
|
|
@@ -77,7 +95,3 @@ Follow the same steps to add ``bootloader`` and ``partition_table`` targets, if
|
|
|
|
|
|
.. _eclipse.org: http://www.eclipse.org/
|
|
|
|
|
|
-Eclipse Troubleshooting
|
|
|
------------------------
|
|
|
-
|
|
|
-* ``*** Make was invoked from ... However please do not run make from the sdk or a component directory; ...`` - Eclipse will detect any directory with a Makefile in it as being a possible directory to run "make" in. All component directories also contain a Makefile (the wrong one), so it is important when using Project -> Make Target to always select the top-level project directory in Project Explorer.
|