2019-06-24 21:26:53 -04:00
***** ***** ***** ***** ***** ***** ***** ***** *** *
Setup Windows Toolchain from Scratch
***** ***** ***** ***** ***** ***** ***** ***** *** *
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
:link_to_translation:`zh_CN:[中文]`
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
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.
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
To quickly setup the toolchain and other tools in standard way, using the ESP-IDF Tools installer, proceed to section :doc: `windows-setup` .
2017-03-26 18:01:52 -04:00
2019-06-24 21:26:53 -04:00
.. _get-esp-idf-windows-command-line:
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Get ESP-IDF
===========
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
.. note ::
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Previous versions of ESP-IDF used the **MSYS2 bash terminal** command line. The current cmake-based build system can run in the regular **Windows Command Prompt** which is used here.
2017-03-20 23:17:19 -04:00
2021-11-09 07:10:56 -05:00
If you use PowerShell, please note that some command syntax will be different to what is shown below.
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Open Command Prompt and run the following commands:
2017-03-20 23:17:19 -04:00
2019-11-12 22:46:16 -05:00
.. include-build-file :: inc/git-clone-windows.inc
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
ESP-IDF will be downloaded into `` %userprofile%\esp\esp-idf `` .
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Consult :doc: `/versions` for information about which ESP-IDF version to use in a given situation.
2017-03-20 23:17:19 -04:00
2019-11-12 22:46:16 -05:00
.. include-build-file :: inc/git-clone-notes.inc
2017-09-20 21:15:09 -04:00
2019-06-24 21:29:49 -04:00
.. note ::
2017-09-20 21:15:09 -04:00
2019-06-24 21:29:49 -04:00
Do not miss the `` --recursive `` option. If you have already cloned ESP-IDF without this option, run another command to get all the submodules::
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
cd esp-idf
git submodule update --init
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Tools
=====
2017-09-20 21:15:09 -04:00
2020-11-30 04:58:27 -05:00
CMake
2019-06-24 21:29:49 -04:00
^^^^^
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Download the latest stable release of CMake_ for Windows and run the installer.
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
When the installer asks for Install Options, choose either "Add CMake to the system PATH for all users" or "Add CMake to the system PATH for the current user".
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Ninja build
^^^^^^^^^^^
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
.. note ::
2021-11-04 10:28:07 -04:00
Ninja currently only provides binaries for 64-bit Windows.
2017-03-20 23:17:19 -04:00
2020-11-30 04:58:27 -05:00
Download the Ninja_ latest stable Windows release from the (`download page <ninja-dl_> `_ ).
2017-03-20 23:17:19 -04:00
2019-08-02 05:09:33 -04:00
The Ninja for Windows download is a .zip file containing a single `` ninja.exe `` file which needs to be unzipped to a directory which is then :ref: `added to your Path <add-directory-windows-path>` (or you can choose a directory which is already on your Path).
2017-03-20 23:17:19 -04:00
2020-02-20 10:00:53 -05:00
Python
^^^^^^
2017-03-20 23:17:19 -04:00
2020-02-20 10:00:53 -05:00
Download the latest Python_ for Windows installer, and run it.
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
The "Customise" step of the Python installer gives a list of options. The last option is "Add python.exe to Path". Change this option to select "Will be installed".
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Once Python is installed, open a Windows Command Prompt from the Start menu and run the following command::
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
pip install --user pyserial
2017-03-20 23:17:19 -04:00
2019-06-24 21:29:49 -04:00
Toolchain Setup
===============
2017-03-26 18:01:52 -04:00
2019-11-12 22:46:16 -05:00
.. include-build-file :: inc/download-links.inc
2018-08-29 09:30:03 -04:00
2019-06-24 21:29:49 -04:00
Download the precompiled Windows toolchain:
2017-03-26 18:01:52 -04:00
2018-08-29 09:30:03 -04:00
|download_link_win32|
2017-03-26 18:01:52 -04:00
2021-01-26 21:12:58 -05:00
Unzip the zip file to `` C:\Program Files `` (or some other location). The zip file contains a single directory `` {IDF_TARGET_TOOLCHAIN_PREFIX} `` .
2017-03-26 18:01:52 -04:00
2021-01-26 21:12:58 -05:00
Next, the `` bin `` subdirectory of this directory must be :ref: `added to your Path <add-directory-windows-path>` . For example, the directory to add may be `` C:\Program Files\{IDF_TARGET_TOOLCHAIN_PREFIX}\bin `` .
2017-03-26 18:01:52 -04:00
2019-06-24 21:26:53 -04:00
.. _add-directory-windows-path:
2017-09-20 21:15:09 -04:00
2019-06-24 21:29:49 -04:00
Adding Directory to Path
2017-09-20 21:15:09 -04:00
========================
2019-06-24 21:29:49 -04:00
To add any new directory to your Windows Path environment variable:
2017-09-20 21:15:09 -04:00
2019-06-24 21:29:49 -04:00
Open the System control panel and navigate to the Environment Variables dialog. (On Windows 10, this is found under Advanced System Settings).
2017-09-20 21:15:09 -04:00
2019-06-24 21:29:49 -04:00
Double-click the `` Path `` variable (either User or System Path, depending if you want other users to have this directory on their path.) Go to the end of the value, and append `` ;<new value> `` .
2017-09-20 21:15:09 -04:00
2019-06-24 21:29:49 -04:00
Next Steps
==========
2017-03-26 18:01:52 -04:00
2020-07-20 07:18:21 -04:00
To carry on with development environment setup, proceed to :ref: `get-started-set-up-tools` .
2019-06-24 21:29:49 -04:00
2019-08-02 05:58:08 -04:00
.. _CMake: https://cmake.org/download/
2020-11-30 04:58:27 -05:00
.. _Ninja: https://ninja-build.org/
2019-08-02 05:09:33 -04:00
.. _ninja-dl: https://github.com/ninja-build/ninja/releases
2019-06-24 21:29:49 -04:00
.. _Python: https://www.python.org/downloads/windows/
2019-08-02 05:58:08 -04:00
.. _kconfig-frontends releases page: https://github.com/espressif/kconfig-frontends/releases
2020-05-19 20:50:44 -04:00
.. Note: These two targets may be used from git-clone-notes.inc depending on version, don't remove
2019-06-24 21:29:49 -04:00
.. _Stable version: https://docs.espressif.com/projects/esp-idf/en/stable/
2021-11-04 10:28:07 -04:00
.. _Releases page: https://github.com/espressif/esp-idf/releases