From 26d6e7563df1df9224e989d661632d44bc3044f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radim=20Karni=C5=A1?= Date: Wed, 17 Apr 2024 14:37:25 +0200 Subject: [PATCH] docs(idf_py): Describe the option to configure esptool.py with --extra-args --- docs/en/api-guides/tools/idf-py.rst | 2 ++ docs/en/api-reference/storage/spiffs.rst | 4 ++++ docs/zh_CN/api-guides/tools/idf-py.rst | 2 ++ docs/zh_CN/api-reference/storage/spiffs.rst | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/docs/en/api-guides/tools/idf-py.rst b/docs/en/api-guides/tools/idf-py.rst index 11dd11a254..81c2dd5d92 100644 --- a/docs/en/api-guides/tools/idf-py.rst +++ b/docs/en/api-guides/tools/idf-py.rst @@ -120,6 +120,8 @@ This command automatically builds the project if necessary, and then flash it to .. note:: The environment variables ``ESPPORT`` and ``ESPBAUD`` can be used to set default values for the ``-p`` and ``-b`` options, respectively. Providing these options on the command line overrides the default. +``idf.py`` uses the ``write_flash`` command of ``esptool.py`` under the hood to flash the target. You can pass additional arguments to configure the flash writing process using the ``--extra-args`` option. For example, to `write to an external SPI flash chip `_, use the following command: ``idf.py flash --extra-args="--spi-connection ,,,,"``. To see the full list of available arguments, run ``esptool.py write_flash --help`` or see the `esptool.py documentation `_. + Similarly to the ``build`` command, the command can be run with ``app``, ``bootloader`` and ``partition-table`` arguments to flash only the app, bootloader or partition table as applicable. Hints on How to Resolve Errors diff --git a/docs/en/api-reference/storage/spiffs.rst b/docs/en/api-reference/storage/spiffs.rst index b70156fa7c..3731b19edc 100644 --- a/docs/en/api-reference/storage/spiffs.rst +++ b/docs/en/api-reference/storage/spiffs.rst @@ -85,6 +85,10 @@ To flash the image onto {IDF_TARGET_NAME} at offset 0x110000, run:: python esptool.py --chip {IDF_TARGET_PATH_NAME} --port [port] --baud [baud] write_flash -z 0x110000 spiffs.bin +.. note:: + + You can configure the ``write_flash`` command of ``esptool.py`` to `write the spiffs data to an external SPI flash chip `_ using the ``--spi-connection ,,,,`` option. Just specify the GPIO pins assigned to the external flash, e.g. ``python esptool.py write_flash --spi-connection 6,7,8,9,11 -z 0x110000 spiffs.bin``. + Notes on which SPIFFS tool to use ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/zh_CN/api-guides/tools/idf-py.rst b/docs/zh_CN/api-guides/tools/idf-py.rst index 449297bd8a..f05546a512 100644 --- a/docs/zh_CN/api-guides/tools/idf-py.rst +++ b/docs/zh_CN/api-guides/tools/idf-py.rst @@ -120,6 +120,8 @@ ESP-IDF 支持多个目标芯片,运行 ``idf.py --list-targets`` 查看当前 .. note:: 环境变量 ``ESPPORT`` 和 ``ESPBAUD`` 可分别设置 ``-p`` 和 ``-b`` 选项的默认值,在命令行上设置这些选项的参数可覆盖默认值。 +``idf.py`` 在内部使用 ``esptool.py`` 的 ``write_flash`` 命令来烧录目标设备。通过 ``--extra-args`` 选项传递额外的参数,并配置烧录过程。例如,要 `写入到外部 SPI flash 芯片 `_,请使用以下命令: ``idf.py flash --extra-args="--spi-connection ,,,,"``。要查看所有可用参数,请运行 ``esptool.py write_flash --help`` 或查看 `esptool.py 文档 `_。 + 与 ``build`` 命令类似,使用 ``app``、``bootloader`` 或 ``partition-table`` 参数运行此命令,可选择仅烧录应用程序、引导加载程序或分区表。 错误处理提示 diff --git a/docs/zh_CN/api-reference/storage/spiffs.rst b/docs/zh_CN/api-reference/storage/spiffs.rst index 095ed065ae..ceeae26d82 100644 --- a/docs/zh_CN/api-reference/storage/spiffs.rst +++ b/docs/zh_CN/api-reference/storage/spiffs.rst @@ -85,6 +85,10 @@ mkspiffs python esptool.py --chip {IDF_TARGET_PATH_NAME} --port [port] --baud [baud] write_flash -z 0x110000 spiffs.bin +.. note:: + + 通过 ``--spi-connection ,,,,`` 选项,可以配置 ``esptool.py`` 的 ``write_flash`` 命令,从而 `将 spiffs 数据写入外部 SPI flash 芯片 `_。只需指定分配给外部 flash 的 GPIO 管脚,如 ``python esptool.py write_flash --spi-connection 6,7,8,9,11 -z 0x110000 spiffs.bin``。 + 选择合适的 SPIFFS 工具 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~