windows-setup.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. ***********************************************
  2. Standard Setup of Toolchain for Windows
  3. ***********************************************
  4. :link_to_translation:`zh_CN:[中文]`
  5. Introduction
  6. ============
  7. ESP-IDF requires some prerequisite tools to be installed so you can build firmware for supported chips. The prerequisite tools include Python, Git, cross-compilers, CMake and Ninja build tools.
  8. For this Getting Started we're going to use the Command Prompt, but after ESP-IDF is installed you can use :doc:`Eclipse <eclipse-setup>` or another graphical IDE with CMake support instead.
  9. .. note::
  10. Limitations:
  11. - The installation path of ESP-IDF and ESP-IDF Tools must not be longer than 90 characters. Too long installation paths might result in a failed build.
  12. - The installation path of Python or ESP-IDF must not contain white spaces or parentheses.
  13. - The installation path of Python or ESP-IDF should not contain special characters (non-ASCII) unless the operating system is configured with "Unicode UTF-8" support.
  14. System Administrator can enable the support via Control Panel - Change date, time, or number formats - Administrative tab - Change system locale - check the option "Beta: Use Unicode UTF-8 for worldwide language support" - Ok and reboot the computer.
  15. .. _get-started-windows-tools-installer:
  16. ESP-IDF Tools Installer
  17. =======================
  18. The easiest way to install ESP-IDF's prerequisites is to download one of ESP-IDF Tools Installers from this URL: https://dl.espressif.com/dl/esp-idf/?idf=4.4
  19. What is the usecase for Online and Offline Installer
  20. ----------------------------------------------------
  21. Online Installer is very small and allows the installation of all available releases of ESP-IDF. The installer will download only necessary dependencies including `Git For Windows`_ during the installation process. The installer stores downloaded files in the cache directory ``%userprofile%\.espressif``
  22. Offline Installer does not require any network connection. The installer contains all required dependencies including `Git For Windows`_ .
  23. Components of the installation
  24. ------------------------------
  25. The installer deploys the following components:
  26. - Embedded Python
  27. - Cross-compilers
  28. - OpenOCD
  29. - CMake_ and Ninja_ build tools
  30. - ESP-IDF
  31. The installer also allows reusing the existing directory with ESP-IDF. The recommended directory is ``%userprofile%\Desktop\esp-idf`` where ``%userprofile%`` is your home directory.
  32. Launching ESP-IDF Environment
  33. -----------------------------
  34. At the end of the installation process you can check out option ``Run ESP-IDF PowerShell Environment`` or ``Run ESP-IDF Command Prompt (cmd.exe)``. The installer will launch ESP-IDF environment in selected prompt.
  35. ``Run ESP-IDF PowerShell Environment``:
  36. .. figure:: ../../_static/esp-idf-installer-screenshot-powershell.png
  37. :align: center
  38. :alt: Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF PowerShell Environment
  39. :figclass: align-center
  40. Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF PowerShell Environment
  41. .. figure:: ../../_static/esp-idf-installer-powershell.png
  42. :align: center
  43. :alt: ESP-IDF PowerShell
  44. :figclass: align-center
  45. ESP-IDF PowerShell
  46. ``Run ESP-IDF Command Prompt (cmd.exe)``:
  47. .. figure:: ../../_static/esp-idf-installer-screenshot.png
  48. :align: center
  49. :alt: Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF Command Prompt (cmd.exe)
  50. :figclass: align-center
  51. Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF Command Prompt (cmd.exe)
  52. .. figure:: ../../_static/esp-idf-installer-command-prompt.png
  53. :align: center
  54. :alt: ESP-IDF Command Prompt
  55. :figclass: align-center
  56. ESP-IDF Command Prompt
  57. Using the Command Prompt
  58. ========================
  59. For the remaining Getting Started steps, we're going to use the Windows Command Prompt.
  60. ESP-IDF Tools Installer also creates a shortcut in the Start menu to launch the ESP-IDF Command Prompt. This shortcut launches the Command Prompt (cmd.exe) and runs ``export.bat`` script to set up the environment variables (``PATH``, ``IDF_PATH`` and others). Inside this command prompt, all the installed tools are available.
  61. Note that this shortcut is specific to the ESP-IDF directory selected in the ESP-IDF Tools Installer. If you have multiple ESP-IDF directories on the computer (for example, to work with different versions of ESP-IDF), you have two options to use them:
  62. 1. Create a copy of the shortcut created by the ESP-IDF Tools Installer, and change the working directory of the new shortcut to the ESP-IDF directory you wish to use.
  63. 2. Alternatively, run ``cmd.exe``, then change to the ESP-IDF directory you wish to use, and run ``export.bat``. Note that unlike the previous option, this way requires Python and Git to be present in ``PATH``. If you get errors related to Python or Git not being found, use the first option.
  64. Next Steps
  65. ==========
  66. If the ESP-IDF Tools Installer has finished successfully, then the development environment setup is complete. Proceed directly to :ref:`get-started-start-project`.
  67. Related Documents
  68. =================
  69. For advanced users who want to customize the install process:
  70. .. toctree::
  71. :maxdepth: 1
  72. windows-setup-update
  73. .. _CMake: https://cmake.org/download/
  74. .. _Ninja: https://ninja-build.org/
  75. .. _Python: https://www.python.org/downloads/windows/
  76. .. _Git for Windows: https://gitforwindows.org/
  77. .. _Github Desktop: https://desktop.github.com/