docs: Make CMake build system default, mark GNU Make as legacy option

All `-cmake` suffixes are removed
Where a GNU Make option is renamed, the `-legacy` suffix is used
This commit is contained in:
Angus Gratton
2019-06-25 11:26:53 +10:00
committed by Angus Gratton
parent 62ed221daf
commit 222146845c
98 changed files with 3429 additions and 3406 deletions
@@ -1,3 +1,3 @@
:orphan:
.. Remove this file when the Chinese translation of CMake getting started guide is updated
.. Remove this file when the Chinese translation of getting started guide is updated
+2 -5
View File
@@ -1,12 +1,9 @@
****************************************
Build and Flash with Eclipse IDE (CMake)
Build and Flash with Eclipse IDE
****************************************
:link_to_translation:`zh_CN:[中文]`
.. include:: ../cmake-warning.rst
Documentation for Eclipse setup with CMake-based build system and Eclipse CDT is coming soon.
.. _eclipse.org: https://www.eclipse.org/
If you require Eclipse IDE support for this pre-release version of ESP-IDF, you can follow the :doc:`legacy GNU Make build system Getting Started guide </get-started-legacy/index>` which has steps for :doc:`Building and Flashing with Eclipse IDE </get-started-legacy/eclipse-setup>`.
@@ -1,4 +1,4 @@
Establish Serial Connection with ESP32 (CMake)
Establish Serial Connection with ESP32
==============================================
:link_to_translation:`zh_CN:[中文]`
@@ -78,7 +78,7 @@ MacOS ::
MacOS users: if you don't see the serial port then check you have the USB/serial drivers installed as shown in the Getting Started guide for your particular development board. For MacOS High Sierra (10.13), you may also have to explicitly allow the drivers to load. Open System Preferences -> Security & Privacy -> General and check if there is a message shown here about "System Software from developer ..." where the developer name is Silicon Labs or FTDI.
.. _linux-dialout-group-cmake:
.. _linux-dialout-group:
Adding user to ``dialout`` on Linux
-----------------------------------
@@ -151,6 +151,6 @@ If you can see readable log output, it means serial connection is working and yo
Close serial terminal after verification that communication is working. In the next step we are going to use a different application to upload a new firmware to ESP32. This application will not be able to access serial port while it is open in terminal.
If you got here from :ref:`get-started-connect-cmake` when installing s/w for ESP32 development, then you can continue with :ref:`get-started-configure-cmake`.
If you got here from :ref:`get-started-connect` when installing s/w for ESP32 development, then you can continue with :ref:`get-started-configure`.
.. _esptool documentation: https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection#automatic-bootloader
+56 -47
View File
@@ -1,13 +1,9 @@
*******************
Get Started (CMake)
*******************
***********
Get Started
***********
:link_to_translation:`zh_CN:[中文]`
.. include:: ../cmake-warning.rst
.. include:: ../cmake-pending-features.rst
This document is intended to help you set up the software development environment for the hardware based on the ESP32 chip by Espressif.
After that, a simple example will show you how to use ESP-IDF (Espressif IoT Development Framework) for menu configuration, then building, and flashing firmware onto an ESP32 board.
@@ -46,7 +42,7 @@ Software:
* **Text editor** to write programs (**Projects**) in C, e.g., `Eclipse <https://www.eclipse.org/>`_
.. figure:: ../../_static/what-you-need-cmake.png
.. figure:: ../../_static/what-you-need.png
:align: center
:alt: Development of applications for ESP32
:figclass: align-center
@@ -68,7 +64,7 @@ If you have one of ESP32 development boards listed below, you can click on the l
ESP32-Ethernet-Kit <../hw-reference/get-started-ethernet-kit>
.. _get-started-step-by-step-cmake:
.. _get-started-step-by-step:
Installation Step by Step
=========================
@@ -78,23 +74,23 @@ This is a detailed roadmap to walk you through the installation process.
Setting up Development Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* :ref:`get-started-get-prerequisites-cmake` for :doc:`Windows <windows-setup>`, :doc:`Linux <linux-setup>` or :doc:`macOS <macos-setup>`
* :ref:`get-started-get-esp-idf-cmake`
* :ref:`get-started-set-up-tools-cmake`
* :ref:`get-started-set-up-env-cmake`
* :ref:`get-started-get-prerequisites` for :doc:`Windows <windows-setup>`, :doc:`Linux <linux-setup>` or :doc:`macOS <macos-setup>`
* :ref:`get-started-get-esp-idf`
* :ref:`get-started-set-up-tools`
* :ref:`get-started-set-up-env`
Creating Your First Project
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* :ref:`get-started-start-project-cmake`
* :ref:`get-started-connect-cmake`
* :ref:`get-started-configure-cmake`
* :ref:`get-started-build-cmake`
* :ref:`get-started-flash-cmake`
* :ref:`get-started-build-monitor-cmake`
* :ref:`get-started-start-project`
* :ref:`get-started-connect`
* :ref:`get-started-configure`
* :ref:`get-started-build`
* :ref:`get-started-flash`
* :ref:`get-started-build-monitor`
.. _get-started-get-prerequisites-cmake:
.. _get-started-get-prerequisites:
Step 1. Install prerequisites
=============================
@@ -108,20 +104,33 @@ Some tools need to be installed on the computer before proceeding to the next st
Linux <linux-setup>
macOS <macos-setup>
* :doc:`windows-setup`
* :doc:`linux-setup`
* :doc:`macos-setup`
+-------------------+-------------------+-------------------+
| |windows-logo| | |linux-logo| | |macos-logo| |
+-------------------+-------------------+-------------------+
| `Windows`_ | `Linux`_ | `Mac OS`_ |
+-------------------+-------------------+-------------------+
.. _get-started-get-esp-idf-cmake:
.. |windows-logo| image:: ../../_static/windows-logo.png
:target: ../get-started/windows-setup.html
.. |linux-logo| image:: ../../_static/linux-logo.png
:target: ../get-started/linux-setup.html
.. |macos-logo| image:: ../../_static/macos-logo.png
:target: ../get-started/macos-setup.html
.. _Windows: ../get-started/windows-setup.html
.. _Linux: ../get-started/linux-setup.html
.. _Mac OS: ../get-started/macos-setup.html
.. _get-started-get-esp-idf:
Step 2. Get ESP-IDF
===================
To build applications for the ESP32, you need the software libraries provided by Espressif in `ESP-IDF repository <https://github.com/espressif/esp-idf>`_.
Get ESP-IDF in accordance with your operating system.
To get ESP-IDF, navigate to your installation directory and clone the repository with ``git clone``.
To get ESP-IDF, navigate to your installation directory and clone the repository with ``git clone``, following instructions below specific to your operating system.
.. note::
@@ -141,13 +150,13 @@ Consult :doc:`/versions` for information about which ESP-IDF version to use in a
Windows
~~~~~~~
In addition to installing the tools, :ref:`get-started-cmake-windows-tools-installer` for Windows introduced in Step 1 can also download a copy of ESP-IDF.
In addition to installing the tools, :ref:`get-started-windows-tools-installer` for Windows introduced in Step 1 can also download a copy of ESP-IDF.
Consult :doc:`/versions` for information about which ESP-IDF version to use in a given situation.
If you wish to download ESP-IDF without the help of ESP-IDF Tools Installer, refer to these :ref:`instructions <get-esp-idf-windows-command-line-cmake>`.
If you wish to download ESP-IDF without the help of ESP-IDF Tools Installer, refer to these :ref:`instructions <get-esp-idf-windows-command-line>`.
.. _get-started-set-up-tools-cmake:
.. _get-started-set-up-tools:
Step 3. Set up the tools
========================
@@ -157,7 +166,7 @@ Aside from the ESP-IDF, you also need to install the tools used by ESP-IDF, such
Windows
~~~~~~~
:ref:`get-started-cmake-windows-tools-installer` for Windows introduced in Step 1 installs all the required tools.
:ref:`get-started-windows-tools-installer` for Windows introduced in Step 1 installs all the required tools.
If you want to install the tools without the help of ESP-IDF Tools Installer, open the Command Prompt and follow these steps:
@@ -181,7 +190,7 @@ The scripts introduced in this step install compilation tools required by ESP-ID
If changing the ``IDF_TOOLS_PATH``, make sure it is set to the same value every time the ``install.bat``/``install.sh`` and ``export.bat``/``export.sh`` scripts are executed.
.. _get-started-set-up-env-cmake:
.. _get-started-set-up-env:
Step 4. Set up the environment variables
========================================
@@ -191,7 +200,7 @@ The installed tools are not yet added to the PATH environment variable. To make
Windows
~~~~~~~
:ref:`get-started-cmake-windows-tools-installer` for Windows creates an "ESP-IDF Command Prompt" shortcut in the Start Menu. This shortcut opens the Command Prompt and sets up all the required environment variables. You can open this shortcut and proceed to the next step.
:ref:`get-started-windows-tools-installer` for Windows creates an "ESP-IDF Command Prompt" shortcut in the Start Menu. This shortcut opens the Command Prompt and sets up all the required environment variables. You can open this shortcut and proceed to the next step.
Alternatively, if you want to use ESP-IDF in an existing Command Prompt window, you can run:
@@ -212,7 +221,7 @@ Note the space between the leading dot and the path!
You can also automate this step, making ESP-IDF tools available in every terminal, by adding this line to your ``.profile`` or ``.bash_profile`` script.
.. _get-started-start-project-cmake:
.. _get-started-start-project:
Step 5. Start a Project
=======================
@@ -245,7 +254,7 @@ It is also possible to build examples in-place, without copying them first.
The ESP-IDF build system does not support spaces in the paths to either ESP-IDF or to projects.
.. _get-started-connect-cmake:
.. _get-started-connect:
Step 6. Connect Your Device
===========================
@@ -265,12 +274,12 @@ If you are not sure how to check the serial port name, please refer to :doc:`est
Keep the port name handy as you will need it in the next steps.
.. _get-started-configure-cmake:
.. _get-started-configure:
Step 7. Configure
=================
Navigate to your ``hello_world`` directory from :ref:`get-started-start-project-cmake` and run the project configuration utility ``menuconfig``.
Navigate to your ``hello_world`` directory from :ref:`get-started-start-project` and run the project configuration utility ``menuconfig``.
Linux and macOS
~~~~~~~~~~~~~~~
@@ -313,7 +322,7 @@ To navigate and use ``menuconfig``, press the following keys:
If you use ESP32-DevKitC board with the **ESP32-SOLO-1** module, enable single core mode (:ref:`CONFIG_FREERTOS_UNICORE`) in menuconfig before flashing examples.
.. _get-started-build-cmake:
.. _get-started-build:
Step 8. Build the Project
=========================
@@ -347,7 +356,7 @@ This command will compile the application and all ESP-IDF components, then it wi
If there are no errors, the build will finish by generating the firmware binary .bin file.
.. _get-started-flash-cmake:
.. _get-started-flash:
Step 9. Flash onto the Device
=============================
@@ -356,7 +365,7 @@ Flash the binaries that you just built onto your ESP32 board by running::
idf.py -p PORT [-b BAUD] flash
Replace PORT with your ESP32 board's serial port name from :ref:`get-started-connect-cmake`.
Replace PORT with your ESP32 board's serial port name from :ref:`get-started-connect`.
You can also change the flasher baud rate by replacing BAUD with the baud rate you need. The default baud rate is ``460800``.
@@ -402,7 +411,7 @@ If there are no issues by the end of the flash process, the module will be reset
.. (Not currently supported) If you'd like to use the Eclipse IDE instead of running ``idf.py``, check out the :doc:`Eclipse guide <eclipse-setup>`.
.. _get-started-build-monitor-cmake:
.. _get-started-build-monitor:
Step 10. Monitor
================
@@ -446,9 +455,9 @@ If IDF monitor fails shortly after the upload, or, if instead of the messages ab
If you have such a problem, do the following:
1. Exit the monitor.
2. Go back to :ref:`menuconfig <get-started-configure-cmake>`.
2. Go back to :ref:`menuconfig <get-started-configure>`.
3. Go to Component config --> ESP32-specific --> Main XTAL frequency, then change :ref:`CONFIG_ESP32_XTAL_FREQ_SEL` to 26MHz.
4. After that, :ref:`build and flash <get-started-flash-cmake>` the application again.
4. After that, :ref:`build and flash <get-started-flash>` the application again.
.. note::
@@ -468,13 +477,13 @@ Now you are ready to try some other :idf:`examples`, or go straight to developin
Updating ESP-IDF
================
You should update ESP-IDF from time to time, as newer versions fix bugs and provide new features. The simplest way to do the update is to delete the existing ``esp-idf`` folder and clone it again, as if performing the initial installation described in :ref:`get-started-get-esp-idf-cmake`.
You should update ESP-IDF from time to time, as newer versions fix bugs and provide new features. The simplest way to do the update is to delete the existing ``esp-idf`` folder and clone it again, as if performing the initial installation described in :ref:`get-started-get-esp-idf`.
Another solution is to update only what has changed. :ref:`The update procedure depends on the version of ESP-IDF you are using <updating>`.
After updating ESP-IDF, execute ``install.sh`` (``install.bat`` on Windows) again, in case the new ESP-IDF version requires different versions of tools. See instructions at :ref:`get-started-set-up-tools-cmake`.
After updating ESP-IDF, execute ``install.sh`` (``install.bat`` on Windows) again, in case the new ESP-IDF version requires different versions of tools. See instructions at :ref:`get-started-set-up-tools`.
Once the new tools are installed, update the environment using ``export.sh`` (``export.bat`` on Windows). See instructions at :ref:`get-started-set-up-env-cmake`.
Once the new tools are installed, update the environment using ``export.sh`` (``export.bat`` on Windows). See instructions at :ref:`get-started-set-up-env`.
Related Documents
=================
@@ -488,4 +497,4 @@ Related Documents
toolchain-setup-scratch
.. _Stable version: https://docs.espressif.com/projects/esp-idf/en/stable/
.. _Releases page: https://github.com/espressif/esp-idf/releases
.. _Releases page: https://github.com/espressif/esp-idf/releases
+3 -5
View File
@@ -1,11 +1,9 @@
******************************************
Setup Linux Toolchain from Scratch (CMake)
Setup Linux Toolchain from Scratch
******************************************
:link_to_translation:`zh_CN:[中文]`
.. include:: ../cmake-warning.rst
The following instructions are alternative to downloading binary toolchain from Espressif website. To quickly setup the binary toolchain, instead of compiling it yourself, backup and proceed to section :doc:`linux-setup`.
Install Prerequisites
@@ -68,10 +66,10 @@ Build the toolchain::
./ct-ng build
chmod -R u+w builds/xtensa-esp32-elf
Toolchain will be built in ``~/esp/crosstool-NG/builds/xtensa-esp32-elf``. To use it, you need to add ``~/esp/crosstool-NG/builds/xtensa-esp32-elf/bin`` to ``PATH`` environment variable.
Toolchain will be built in ``~/esp/crosstool-NG/builds/xtensa-esp32-elf``. Follow `instructions for standard setup <setup-linux-toolchain-add-it-to-path>`_ to add the toolchain to your ``PATH``.
Next Steps
==========
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf-cmake`.
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf`.
+5 -7
View File
@@ -1,11 +1,9 @@
***********************************************
Installation of Prerequisites for Linux (CMake)
***********************************************
*********************************************
Standard Setup of Toolchain for Linux
*********************************************
:link_to_translation:`zh_CN:[中文]`
.. include:: ../cmake-warning.rst
Install Prerequisites
=====================
@@ -32,7 +30,7 @@ Additional Tips
Permission issues /dev/ttyUSB0
------------------------------
With some Linux distributions you may get the ``Failed to open port /dev/ttyUSB0`` error message when flashing the ESP32. :ref:`This can be solved by adding the current user to the dialout group<linux-dialout-group-cmake>`.
With some Linux distributions you may get the ``Failed to open port /dev/ttyUSB0`` error message when flashing the ESP32. :ref:`This can be solved by adding the current user to the dialout group<linux-dialout-group>`.
Arch Linux Users
@@ -53,7 +51,7 @@ Alternatively, use crosstool-NG to compile a gdb that links against ncurses 6.
Next Steps
==========
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf-cmake`.
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf`.
Related Documents
+2 -4
View File
@@ -1,11 +1,9 @@
***********************************************
Setup Toolchain for Mac OS from Scratch (CMake)
Setup Toolchain for Mac OS from Scratch
***********************************************
:link_to_translation:`zh_CN:[中文]`
.. include:: ../cmake-warning.rst
Package Manager
===============
@@ -85,4 +83,4 @@ Toolchain will be built in ``~/esp/ctng-volume/crosstool-NG/builds/xtensa-esp32-
Next Steps
==========
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf-cmake`.
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf`.
+4 -6
View File
@@ -1,11 +1,9 @@
***********************************************
Installation of Prerequisites for macOS (CMake)
***********************************************
**********************************************
Standard Setup of Toolchain for Mac OS
**********************************************
:link_to_translation:`zh_CN:[中文]`
.. include:: ../cmake-warning.rst
Install Prerequisites
=====================
@@ -43,7 +41,7 @@ ESP-IDF will use the version of Python installed by default on macOS.
Next Steps
==========
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf-cmake`.
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf`.
Related Documents
=================
@@ -1,12 +1,12 @@
.. _get-started-customized-setup-cmake:
.. _get-started-customized-setup:
*************************************
Customized Setup of Toolchain (CMake)
Customized Setup of Toolchain
*************************************
:link_to_translation:`zh_CN:[中文]`
Instead of downloading binary toolchain from Espressif website (see :ref:`get-started-set-up-tools-cmake`) you may build the toolchain yourself.
Instead of downloading binary toolchain from Espressif website (see :ref:`get-started-set-up-tools`) you may build the toolchain yourself.
If you can't think of a reason why you need to build it yourself, then probably it's better to stick with the binary version. However, here are some of the reasons why you might want to compile it from source:
@@ -1,11 +1,9 @@
**********************************
Windows Setup from Scratch (CMake)
**********************************
********************************************
Setup Windows Toolchain from Scratch
********************************************
:link_to_translation:`zh_CN:[中文]`
.. include:: ../cmake-warning.rst
This is a step-by-step alternative to running the :doc:`ESP-IDF Tools Installer <windows-setup>` for the CMake-based build system. Installing all of the tools by hand allows more control over the process, and also provides the information for advanced users to customize the install.
To quickly setup the toolchain and other tools in standard way, using the ESP-IDF Tools installer, proceed to section :doc:`windows-setup`.
@@ -13,7 +11,7 @@ To quickly setup the toolchain and other tools in standard way, using the ESP-ID
.. note::
The GNU Make based build system requires the MSYS2_ Unix compatibility environment on Windows. The CMake-based build system does not require this environment.
.. _get-esp-idf-windows-command-line-cmake:
.. _get-esp-idf-windows-command-line:
Get ESP-IDF
===========
@@ -98,7 +96,7 @@ Next, the ``bin`` subdirectory of this directory must be `added to your Path <ad
If you already have the MSYS2 environment (for use with the "GNU Make" build system) installed, you can skip the separate download and add the directory ``C:\msys32\opt\xtensa-esp32-elf\bin`` to the Path instead, as the toolchain is included in the MSYS2 environment.
.. _add-directory-windows-path-cmake:
.. _add-directory-windows-path:
Adding Directory to Path
========================
@@ -113,7 +111,7 @@ Double-click the ``Path`` variable (either User or System Path, depending if you
Next Steps
==========
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf-cmake`.
To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf`.
.. _ninja: https://ninja-build.org/
.. _Python: https://www.python.org/downloads/windows/
+2 -2
View File
@@ -2,7 +2,7 @@
Updating ESP-IDF tools on Windows
*********************************
.. _get-started-cmake-install_bat-windows:
.. _get-started-install_bat-windows:
Install ESP-IDF tools using ``install.bat``
===========================================
@@ -14,7 +14,7 @@ From the Windows Command Prompt, change to the directory where ESP-IDF is instal
This will download and install the tools necessary to use ESP-IDF. If the specific version of the tool is already installed, no action will be taken.
The tools are downloaded and installed into a directory specified during ESP-IDF Tools Installer process. By default, this is ``C:\Users\username\.espressif``.
.. _get-started-cmake-export_bat-windows:
.. _get-started-export_bat-windows:
Add ESP-IDF tools to PATH using ``export.bat``
==============================================
+6 -8
View File
@@ -1,13 +1,11 @@
*************************************************
Installation of Prerequisites for Windows (CMake)
*************************************************
***********************************************
Standard Setup of Toolchain for Windows
***********************************************
:link_to_translation:`zh_CN:[中文]`
.. include:: ../cmake-warning.rst
.. note::
The CMake-based build system is only supported on 64-bit versions of Windows.
Currently only 64-bit versions of Windows are supported. 32-bit Windows can use the :doc:`Legacy GNU Make Build System<../get-started-legacy/windows-setup>`.
Introduction
============
@@ -19,7 +17,7 @@ For this Getting Started we're going to use the Command Prompt, but after ESP-ID
.. note::
The GNU Make based build system requires the MSYS2_ Unix compatibility environment on Windows. The CMake-based build system does not require this environment.
.. _get-started-cmake-windows-tools-installer:
.. _get-started-windows-tools-installer:
ESP-IDF Tools Installer
=======================
@@ -48,7 +46,7 @@ Note that this shortcut is specific to the ESP-IDF directory selected in the ESP
Next Steps
==========
If the ESP-IDF Tools Installer has finished successfully, then the development environment setup is complete. Proceed directly to :ref:`get-started-start-project-cmake`.
If the ESP-IDF Tools Installer has finished successfully, then the development environment setup is complete. Proceed directly to :ref:`get-started-start-project`.
Related Documents
=================