windows-setup.rst 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 are going to use the Command Prompt, but after ESP-IDF is installed you can use `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md>`_ 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`` > 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.
  19. +-------------------+--------------------------------+
  20. | |download-logo| | `Windows Installer Download`_ |
  21. +-------------------+--------------------------------+
  22. .. |download-logo| image:: ../../_static/logo_windows_install.png
  23. :target: https://dl.espressif.com/dl/esp-idf/?idf=4.4
  24. .. _Windows Installer Download: https://dl.espressif.com/dl/esp-idf/?idf=4.4
  25. What Is the Usecase for Online and Offline Installer
  26. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  27. Online Installer is very small and allows the installation of all available releases of ESP-IDF. The installer downloads only necessary dependencies including `Git For Windows`_ during the installation process. The installer stores downloaded files in the cache directory ``%userprofile%\.espressif``
  28. Offline Installer does not require any network connection. The installer contains all required dependencies including `Git For Windows`_ .
  29. Components of the Installation
  30. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  31. The installer deploys the following components:
  32. - Embedded Python
  33. - Cross-compilers
  34. - OpenOCD
  35. - CMake_ and Ninja_ build tools
  36. - ESP-IDF
  37. 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.
  38. Launching ESP-IDF Environment
  39. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40. 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 launches ESP-IDF environment in selected prompt.
  41. ``Run ESP-IDF PowerShell Environment``:
  42. .. figure:: ../../_static/esp-idf-installer-screenshot-powershell.png
  43. :align: center
  44. :alt: Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF PowerShell Environment
  45. :figclass: align-center
  46. Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF PowerShell Environment
  47. .. figure:: ../../_static/esp-idf-installer-powershell.png
  48. :align: center
  49. :alt: ESP-IDF PowerShell
  50. :figclass: align-center
  51. ESP-IDF PowerShell
  52. ``Run ESP-IDF Command Prompt (cmd.exe)``:
  53. .. figure:: ../../_static/esp-idf-installer-screenshot.png
  54. :align: center
  55. :alt: Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF Command Prompt (cmd.exe)
  56. :figclass: align-center
  57. Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF Command Prompt (cmd.exe)
  58. .. figure:: ../../_static/esp-idf-installer-command-prompt.png
  59. :align: center
  60. :alt: ESP-IDF Command Prompt
  61. :figclass: align-center
  62. ESP-IDF Command Prompt
  63. Using the Command Prompt
  64. ========================
  65. For the remaining Getting Started steps, we are going to use the Windows Command Prompt.
  66. 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.
  67. 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:
  68. 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.
  69. 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.
  70. First Steps on ESP-IDF
  71. ======================
  72. .. _get-started-windows-first-steps:
  73. .. include:: windows-start-project.rst
  74. .. include:: start-project.rst
  75. Related Documents
  76. =================
  77. For advanced users who want to customize the install process:
  78. * :doc:`windows-setup-update`
  79. * :doc:`establish-serial-connection`
  80. * `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md>`_
  81. * `VSCode Extension <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md>`_
  82. * :doc:`../api-guides/tools/idf-monitor`
  83. .. toctree::
  84. :hidden:
  85. :maxdepth: 1
  86. windows-setup-update
  87. establish-serial-connection
  88. flashing-troubleshooting
  89. ../api-guides/tools/idf-monitor
  90. .. _CMake: https://cmake.org/download/
  91. .. _Ninja: https://ninja-build.org/
  92. .. _Python: https://www.python.org/downloads/windows/
  93. .. _Git for Windows: https://gitforwindows.org/
  94. .. _Github Desktop: https://desktop.github.com/