From 6c2fb57df8e3a6c6a5f8d0c493ee57973e51df7d Mon Sep 17 00:00:00 2001 From: Shang Zhou Date: Tue, 8 Aug 2023 17:39:04 +0800 Subject: [PATCH] docs: update CN translation for nvs_flash.rst --- docs/en/api-reference/storage/nvs_flash.rst | 4 +-- .../zh_CN/api-reference/storage/nvs_flash.rst | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/docs/en/api-reference/storage/nvs_flash.rst b/docs/en/api-reference/storage/nvs_flash.rst index c4242ab42b..8e0bec9db6 100644 --- a/docs/en/api-reference/storage/nvs_flash.rst +++ b/docs/en/api-reference/storage/nvs_flash.rst @@ -122,9 +122,9 @@ Instead of calling the ``nvs_partition_gen.py`` tool manually, the creation of t - Specify files on which the command depends -If FLASH_IN_PROJECT is not specified, the image will still be generated, but you will have to flash it manually using ``idf.py -flash`` (e.g. if your parition name is ``nvs`` ``idf.py nvs-flash``). +If ``FLASH_IN_PROJECT`` is not specified, the image will still be generated, but you will have to flash it manually using ``idf.py -flash`` (e.g., if your parition name is ``nvs``, then use ``idf.py nvs-flash``). -``nvs_create_partition_image`` must be called from one of the component ``CMakeLists.txt`` files. Currently only non-encrypted partitions are supported. +``nvs_create_partition_image`` must be called from one of the component ``CMakeLists.txt`` files. Currently, only non-encrypted partitions are supported. Application Example ------------------- diff --git a/docs/zh_CN/api-reference/storage/nvs_flash.rst b/docs/zh_CN/api-reference/storage/nvs_flash.rst index 4a3914f038..a36b7189bd 100644 --- a/docs/zh_CN/api-reference/storage/nvs_flash.rst +++ b/docs/zh_CN/api-reference/storage/nvs_flash.rst @@ -92,6 +92,40 @@ NVS 分区生成程序 NVS 分区生成程序帮助生成 NVS 分区二进制文件,可使用烧录程序将二进制文件单独烧录至特定分区。烧录至分区上的键值对由 CSV 文件提供,详情请参考 :doc:`nvs_partition_gen`。 +可以直接使用函数 ``nvs_create_partition_image`` 通过 CMake 创建分区二进制文件,无需手动调用 ``nvs_partition_gen.py`` 工具:: + + nvs_create_partition_image( [FLASH_IN_PROJECT] [DEPENDS dep dep dep ...]) + +**位置参数**: + +.. list-table:: + :header-rows: 1 + + * - 参数 + - 描述 + * - ``partition`` + - NVS 分区名 + * - ``csv`` + - 解析的 CSV 文件路径 + + +**可选参数**: + +.. list-table:: + :header-rows: 1 + + * - 参数 + - 描述 + * - ``FLASH_IN_PROJECT`` + - NVS 分区名 + * - ``DEPENDS`` + - 指定命令依赖的文件 + + +在没有指定 ``FLASH_IN_PROJECT`` 的情况下,也支持生成分区镜像,不过此时需要使用 ``idf.py -flash`` 手动进行烧录。举个例子,如果分区名为 ``nvs``,则需使用的命令为 ``idf.py nvs-flash``。 + +目前,仅支持从组件中的 ``CMakeLists.txt`` 文件调用 ``nvs_create_partition_image``,且此选项仅适用于非加密分区。 + 应用示例 -------------------