Skip to content

Commit 19d370f

Browse files
committed
docs: how to update ESP-IDF environment without updating ESP-IDF itself
Closes #16077
1 parent bac996a commit 19d370f

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

docs/en/api-guides/tools/idf-tools.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This file is used by the :idf_file:`tools/idf_tools.py` script when installing t
3535
Tools Installation Directory
3636
----------------------------
3737

38-
The ``IDF_TOOLS_PATH`` environment variable specifies the location where the tools are to be downloaded and installed. If not set, the default location will be ``HOME/.espressif`` on Linux and macOS, and ``%USER_PROFILE%\.espressif`` on Windows.
38+
The ``IDF_TOOLS_PATH`` environment variable specifies the location where the tools are to be downloaded and installed. If not set, the default location will be ``$HOME/.espressif`` on Linux and macOS, and ``%USER_PROFILE%\.espressif`` on Windows.
3939

4040
Inside the ``IDF_TOOLS_PATH`` directory, the tools installation scripts create the following directories and files:
4141

@@ -60,6 +60,7 @@ Any mirror server can be used provided the URL matches the ``github.com`` downlo
6060

6161
.. note:: The Espressif download server currently does not mirror everything from GitHub, but only files attached as Assets to some releases, as well as source archives for some releases.
6262

63+
.. _idf-tools-py:
6364

6465
``idf_tools.py`` Script
6566
-----------------------
@@ -119,7 +120,7 @@ The :idf_file:`tools/idf_tools.py` script bundled with ESP-IDF performs several
119120

120121
* ``check``: For each tool, checks whether the tool is available in the system path and in ``IDF_TOOLS_PATH``.
121122

122-
* ``install-python-env``: Creates a Python virtual environment in the ``${IDF_TOOLS_PATH}/python_env`` directory or directly in the directory set by the ``IDF_PYTHON_ENV_PATH`` environment variable, and install the required Python packages there.
123+
* ``install-python-env``: Creates a Python virtual environment in the ``${IDF_TOOLS_PATH}/python_env`` directory or directly in the directory set by the ``IDF_PYTHON_ENV_PATH`` environment variable, and installs the required Python packages there. If the Python virtual environment already exists, packages inside are updated to their latest versions with respect to the ``espidf.constraints.*.txt`` file.
123124

124125
* An optional ``--features`` argument allows one to specify a comma-separated list of features to be added or removed.
125126

docs/en/get-started/linux-macos-setup.rst

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,18 +277,29 @@ Step 5. First Steps on ESP-IDF
277277
.. include:: linux-macos-start-project.rst
278278
.. include:: start-project.rst
279279

280-
Tip: Updating ESP-IDF
281-
======================
280+
.. _get-started-update-esp-idf:
281+
282+
Updating ESP-IDF and Python Packages in the ESP-IDF Environment
283+
===============================================================
282284

283285
It is recommended to update ESP-IDF from time to time, as newer versions fix bugs and/or provide new features. Please note that each ESP-IDF major and minor release version has an associated support period, and when one release branch is approaching end of life (EOL), all users are encouraged to upgrade their projects to more recent ESP-IDF releases, to find out more about support periods, see :doc:`ESP-IDF Versions <../versions>`.
284286

285287
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`.
286288

287-
Another solution is to update only what has changed. :ref:`The update procedure depends on the version of ESP-IDF you are using <updating>`.
289+
Another solution is to update only what has changed. For specific instructions, please visit :ref:`Updating ESP-IDF <updating-master>` page.
290+
291+
After updating ESP-IDF, execute the install script again (``./install.sh`` in your ``$IDF_PATH``), in case the new ESP-IDF version requires different versions of tools. See instructions at :ref:`get-started-set-up-tools`.
292+
293+
Once all the new tools are installed, enter the ESP-IDF environment using the export script as described in :ref:`get-started-set-up-env`.
288294

289-
After updating ESP-IDF, execute the Install script again, in case the new ESP-IDF version requires different versions of tools. See instructions at :ref:`get-started-set-up-tools`.
295+
Updating Python Packages in the ESP-IDF Environment Without Updating ESP-IDF
296+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297+
298+
Some features in ESP-IDF are not included directly in the ESP-IDF repository. Instead, they are provided by Python packages such as ``esp-idf-monitor`` or ``esptool``, which are installed in the ESP-IDF environment by the install script. These packages can be updated independently of ESP-IDF. To update them, simply re-run the install script (``./install.sh`` in your ``$IDF_PATH``). If the ESP-IDF environment already exists, the script will update all Python packages in it to the latest versions compatible with the current ESP-IDF version — without updating the ESP-IDF itself.
299+
300+
.. note::
290301

291-
Once the new tools are installed, update the environment using the Export script. See instructions at :ref:`get-started-set-up-env`.
302+
If you are an advanced user and want more control over the update process, you can also check :ref:`idf-tools-py` and its ``install-python-env`` command, which is used by the install script and handles the creation or update of the ESP-IDF environment.
292303

293304
Related Documents
294305
=================

tools/idf_tools.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3476,7 +3476,12 @@ def main(argv: List[str]) -> None:
34763476
)
34773477

34783478
install_python_env = subparsers.add_parser(
3479-
'install-python-env', help=('Create Python virtual environment and install the required Python packages')
3479+
'install-python-env',
3480+
help=(
3481+
'Create a Python virtual environment and install the required Python packages. '
3482+
'If the virtual environment already exists, update all Python packages to the latest '
3483+
'versions compatible with the current ESP-IDF version.'
3484+
),
34803485
)
34813486
install_python_env.add_argument(
34823487
'--reinstall', help='Discard the previously installed environment', action='store_true'

0 commit comments

Comments
 (0)