windows-setup.rst 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ***********************************************
  2. Standard Setup of Toolchain for Windows (CMake)
  3. ***********************************************
  4. :link_to_translation:`zh_CN:[中文]`
  5. .. include:: ../cmake-warning.rst
  6. .. note::
  7. The CMake-based build system is only supported on 64-bit versions of Windows.
  8. Introduction
  9. ============
  10. ESP-IDF requires some prerequisite tools to be installed so you can build firmware for the ESP32. The prerequisite tools include Git, a cross-compiler and the CMake build tool. We'll go over each one in this document.
  11. For this Getting Started we're going to use a command prompt, but after ESP-IDF is installed you can use :doc:`Eclipse <eclipse-setup>` or another graphical IDE with CMake support instead.
  12. .. note::
  13. The GNU Make based build system requires the MSYS2_ Unix compatibility environment on Windows. The CMake-based build system does not require this environment.
  14. ESP-IDF Tools Installer
  15. =======================
  16. The easiest way to install ESP-IDF's prerequisites is to download the ESP-IDF Tools installer from this URL:
  17. https://dl.espressif.com/dl/esp-idf-tools-setup-1.2.exe
  18. The installer will automatically install the ESP32 Xtensa gcc toolchain, Ninja_ build tool, and a configuration tool called mconf-idf_. The installer can also download and run installers for CMake_ and Python_ 2.7 if these are not already installed on the computer.
  19. By default, the installer updates the Windows ``Path`` environment variable so all of these tools can be run from anywhere. If you disable this option, you will need to configure the environment where you are using ESP-IDF (terminal or chosen IDE) with the correct paths.
  20. Note that this installer is for the ESP-IDF Tools package, it doesn't include ESP-IDF itself.
  21. Installing Git
  22. ==============
  23. The ESP-IDF tools installer does not install Git. By default, the getting started guide assumes you will be using Git on the command line. You can download and install a command line Git for Windows (along with the "Git Bash" terminal) from `Git For Windows`_.
  24. If you prefer to use a different graphical Git client, then you can install one such as `Github Desktop`. You will need to translate the Git commands in the Getting Started guide for use with your chosen Git client.
  25. Using a Terminal
  26. ================
  27. For the remaining Getting Started steps, we're going to use a terminal command prompt. It doesn't matter which command prompt you use:
  28. - You can use the built-in Windows Command Prompt, under the Start menu. All Windows command line instructions in this documentation are "batch" commands for use with the Windows Command Prompt.
  29. - You can use the "Git Bash" terminal which is part of `Git for Windows`_. This uses the same "bash" command prompt syntax as is given for Mac OS or Linux. You can find it in the Start menu once installed.
  30. - If you have MSYS2_ installed (maybe from a previous ESP-IDF version), then you can also use the MSYS terminal.
  31. Next Steps
  32. ==========
  33. To carry on with development environment setup, proceed to section :ref:`get-started-get-esp-idf-cmake`.
  34. Related Documents
  35. =================
  36. For advanced users who want to customize the install process:
  37. .. toctree::
  38. :maxdepth: 1
  39. windows-setup-scratch
  40. .. _MSYS2: https://msys2.github.io/
  41. .. _cmake: https://cmake.org/download/
  42. .. _ninja: https://ninja-build.org/
  43. .. _Python: https://www.python.org/downloads/windows/
  44. .. _Git for Windows: https://gitforwindows.org/
  45. .. _mconf-idf: https://github.com/espressif/kconfig-frontends/releases/
  46. .. _Github Desktop: https://desktop.github.com/