Skip to content

Commit 3c99557

Browse files
committed
Merge branch 'docs/update_cn_translation' into 'master'
docs: Update CN translation for several docs Closes DOC-8745 and DOC-8735 See merge request espressif/esp-idf!33071
2 parents db50b1a + f6003fb commit 3c99557

File tree

6 files changed

+60
-21
lines changed

6 files changed

+60
-21
lines changed

docs/en/api-guides/fatal-errors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Indicates that an interrupt watchdog timeout has occurred. See :doc:`Watchdogs <
398398
|CACHE_ERR_MSG|
399399
^^^^^^^^^^^^^^^
400400

401-
In some situations, ESP-IDF will temporarily disable access to external SPI Flash and SPI RAM via caches. For example, this happens when spi_flash APIs are used to read/write/erase/mmap regions of SPI Flash. In these situations, tasks are suspended, and interrupt handlers not registered with ``ESP_INTR_FLAG_IRAM`` are disabled. Make sure that any interrupt handlers registered with this flag have all the code and data in IRAM/DRAM. For more details, see the :ref:`SPI flash API documentation <iram-safe-interrupt-handlers>` and the :ref:`IRAM-Safe Interrupt Handlers <iram_safe_interrupts_handlers>` section.
401+
In some situations, ESP-IDF will temporarily disable access to external SPI flash and SPI RAM via caches. For example, this happens when spi_flash APIs are used to read/write/erase/mmap regions of SPI flash. In these situations, tasks are suspended, and interrupt handlers not registered with ``ESP_INTR_FLAG_IRAM`` are disabled. Make sure that any interrupt handlers registered with this flag have all the code and data in IRAM/DRAM. For more details, see the :ref:`SPI flash API documentation <iram-safe-interrupt-handlers>` and the :ref:`IRAM-Safe Interrupt Handlers <iram_safe_interrupts_handlers>` section.
402402

403403
.. only:: SOC_MEMPROT_SUPPORTED
404404

docs/en/api-reference/system/intr_alloc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ To illustrate why shared interrupts can only be level-triggered, take the scenar
9494
IRAM-Safe Interrupt Handlers
9595
----------------------------
9696

97-
When performing write and erase operations on SPI flash, the {IDF_TARGET_NAME} will disable the cache, making SPI flash and SPIRAM inaccessible for interrupt handlers. This is why there are two types of interrupt handlers in ESP-IDF, which have their advantages and disadvantages:
97+
When performing write and erase operations on SPI flash, {IDF_TARGET_NAME} will disable the cache, making SPI flash and SPIRAM inaccessible for interrupt handlers. This is why there are two types of interrupt handlers in ESP-IDF, which have their advantages and disadvantages:
9898

9999
**IRAM-safe interrupt handlers** - only access code and data in internal memory (IRAM for code, DRAM for data).
100100

docs/en/contribute/documenting-code.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ Building Documentation
173173
To build documentation, start by installing the dependencies:
174174

175175
1. Install `Doxygen <https://www.doxygen.nl/manual/install.html>`_.
176-
2. Chances are you already set up the required `tools <https://docs.espressif.com/projects/esp-idf/en/stable/get-started/linux-macos-setup.html#step-3-set-up-the-tools>`_ by running ``./install.sh``. To enable building docs, you need to run:
176+
2. Chances are you already set up the required `tools <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html#step-3-set-up-the-tools>`_ by running ``./install.sh``. To enable building docs, you need to run:
177177

178-
.. code-block:: bash
178+
.. code-block:: bash
179179
180-
./install.sh --enable-docs
180+
./install.sh --enable-docs
181181
182-
This action will install the ``esp-docs`` Python package. This package is a wrapper around `Sphinx <https://www.sphinx-doc.org/>`_ and is required to build ESP-IDF documentation.
182+
This action will install the ``esp-docs`` Python package. This package is a wrapper around `Sphinx <https://www.sphinx-doc.org/>`_ and is required to build ESP-IDF documentation.
183183

184184
After installing the dependencies, go to the ``docs`` folder and run the following to build the documentation:
185185

docs/zh_CN/api-guides/fatal-errors.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,17 @@ Interrupt wdt timeout on CPU0 / CPU1
393393

394394
这表示发生了中断看门狗超时,详细信息请查阅 :doc:`看门狗 <../api-reference/system/wdts>` 文档。
395395

396+
.. _cache_error:
397+
396398
|CACHE_ERR_MSG|
397399
^^^^^^^^^^^^^^^
398400

399-
在某些情况下,ESP-IDF 会暂时禁止通过高速缓存访问外部 SPI flash 和 SPI RAM,例如在使用 spi_flash API 读取/写入/擦除/映射 SPI flash 的时候。在这些情况下,任务会被挂起,并且未使用 ``ESP_INTR_FLAG_IRAM`` 注册的中断处理程序会被禁用。请确保任何使用此标志注册的中断处理程序所访问的代码和数据分别位于 IRAM 和 DRAM 中。更多详细信息请参阅 :ref:`SPI flash API 文档 <iram-safe-interrupt-handlers>`。
401+
某些情况下,ESP-IDF 会暂时禁止通过 cache 访问外部 SPI flash 和 SPI RAM,例如在使用 spi_flash API 读取/写入/擦除/映射 SPI flash 的时候。在这些情况下,任务会被挂起,并且未使用 ``ESP_INTR_FLAG_IRAM`` 注册的中断处理程序会被禁用。请确保任何使用此标志注册的中断处理程序所访问的代码和数据分别位于 IRAM 和 DRAM 中。更多详细信息请参阅 :ref:`SPI flash API 文档 <iram-safe-interrupt-handlers>` 和 :ref:`IRAM 安全中断处理程序 <iram_safe_interrupts_handlers>`。
400402

401403
.. only:: SOC_MEMPROT_SUPPORTED
402404

403-
Memory protection fault
404-
^^^^^^^^^^^^^^^^^^^^^^^
405+
内存保护错误
406+
^^^^^^^^^^^^
405407

406408
ESP-IDF 中使用 {IDF_TARGET_NAME} 的权限控制功能来防止以下类型的内存访问:
407409

docs/zh_CN/api-reference/system/intr_alloc.rst

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,45 @@
8989

9090
须注意从未关联到内核的任务中调用 :cpp:func:`esp_intr_alloc` 的情况。在任务切换期间,这些任务可能在不同内核之间进行迁移,因此无法确定中断分配到了哪个 CPU,给释放中断句柄造成困难,也可能引起调试问题。建议使用特定 CoreID 参数的 :cpp:func:`xTaskCreatePinnedToCore` 来创建中断分配任务,这对于内部中断源而言是必要的。
9191

92+
.. _iram_safe_interrupts_handlers:
9293

93-
IRAM-safe 中断处理程序
94-
----------------------
94+
IRAM 安全中断处理程序
95+
---------------------
9596

96-
``ESP_INTR_FLAG_IRAM`` flag 注册的中断处理程序始终在 IRAM(并从 DRAM 读取其所有数据)中运行,因此在擦除和写入 flash 时无需禁用。
97+
在执行 SPI flash 的写入和擦除操作时,{IDF_TARGET_NAME} 会禁用 cache,中断处理程序将无法访问 SPI flash 和 SPIRAM。因此,ESP-IDF 中存在两种中断处理程序,它们各有优缺点:
9798

98-
这对于需要保证最小执行延迟的中断来说非常有用,因为 flash 写入和擦除操作可能很慢(擦除可能需要数十毫秒或数百毫秒才能完成)。
99+
**IRAM 安全中断处理程序** - 只能访问内部内存中的代码和数据(代码存储在 IRAM 中,数据存储在 DRAM 中)。
99100

100-
如果中断被频繁调用,可以将中断处理程序保留在 IRAM 中,避免 flash cache 丢失。
101+
.. list::
102+
103+
- **+** **延迟**:flash 写入和擦除操作相对缓慢,例如擦除可能需要几十或几百毫秒才能完成,但这些中断处理程序不受影响,执行速度较快且延迟较低,能够保证最小执行延迟。
104+
- **-** **占用内部内存**:中断处理程序占用了宝贵的内部内存,这些内存本可以用于其他目的。
105+
- **+** **cache 未命中**:中断处理程序不依赖 cache, 因此就不会出现 cache 未命中带来的不确定性,因为代码和数据已存储在内部存储器中了。
106+
- **使用场景**:请使用 :c:macro:`ESP_INTR_FLAG_IRAM` 标志,通过中断分配器 API 注册此类中断。
107+
108+
**非 IRAM 安全中断处理程序** - 可能会访问 flash 中的代码和(只读)数据。
109+
110+
.. list::
111+
112+
- **-** **延迟**:在进行 flash 操作时,中断处理程序会被推迟,因此平均延迟较高且难以预测。
113+
- **+** **占用内部内存**:该中断处理程序不使用内部 RAM,或者使用的内存比 IRAM 安全中断要少。
114+
- **使用场景**:通过中断分配器 API 注册此类中断时,请 **不要** 使用 :c:macro:`ESP_INTR_FLAG_IRAM` 标志。
115+
116+
*请注意,没有任何显式标记将中断处理程序标识为 IRAM 安全。* 当且仅当要访问的代码和数据存储在内部内存中时,中断处理程序才被隐式标记为 IRAM 安全。“IRAM 安全”这个术语实际上有点误导性,因为除了将处理程序的代码放在 IRAM 中之外,还有更多其他要求。以下是 **不属于** IRAM 安全的中断处理程序示例:
117+
118+
.. list::
119+
120+
- 部分代码放置在 flash 中。
121+
- 放置在 IRAM 中但调用了存储在 flash 里的函数。
122+
- 代码放置在 IRAM 中但访问了位于 flash 中的只读变量。
123+
124+
关于如何将代码和数据放置在 IRAM 或 DRAM 中,请参见 :ref:`how-to-place-code-in-iram`。
125+
126+
有关 SPI flash 操作及其与中断处理程序交互的更多详细信息,请参见 :ref:`SPI flash API 文档 <iram-safe-interrupt-handlers>`。
127+
128+
.. note::
101129

102-
有关更多详细信息,请参阅 :ref:`SPI flash API 相关文档 <iram-safe-interrupt-handlers>`
130+
如果不能 100% 确定中断处理程序访问的所有代码和数据都位于 IRAM(代码)或 DRAM(数据)中,切勿使用 ``ESP_INTR_FLAG_IRAM`` 标志注册中断处理程序。忽略这一点将导致(有时是偶发性的):ref:`cache 错误 <cache_error>`。通过调用函数间接访问代码和数据时也需要注意这点
103131

104132
.. _intr-alloc-shared-interrupts:
105133

docs/zh_CN/contribute/documenting-code.rst

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,30 @@ Doxygen 支持多种格式,并支持文档内部的多个详情级别,具有
170170
构建文档
171171
-----------
172172

173-
文档由基于 `Sphinx <https://www.sphinx-doc.org/>`_ 的 Python 包 `esp-docs` 进行构建。
173+
要构建文档,请先安装以下依赖项:
174174

175-
安装命令::
175+
1. 安装 `Doxygen <https://www.doxygen.nl/manual/install.html>`_。
176+
2. 如果已经通过运行 ``./install.sh`` 设置好了所需的 `工具 <https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/linux-macos-setup.html#get-started-set-up-tools>`_,请运行以下命令,启用文档构建功能:
176177

177-
pip install esp-docs
178+
.. code-block:: bash
178179
179-
安装成功后,使用如下命令在 docs 文件夹中构建文档::
180+
./install.sh --enable-docs
181+
182+
上述操作将安装 ``esp-docs`` Python 包。该包是 `Sphinx <https://www.sphinx-doc.org/>`_ 的一个封装器,用于构建 ESP-IDF 文档。
183+
184+
安装好依赖项后,进入 ``docs`` 文件夹并运行以下命令构建文档:
185+
186+
.. code-block:: bash
180187
181188
build-docs build
182189
183-
或使用以下命令指定目标芯片和语言::
190+
也可以通过指定目标和语言,仅构建所需的文档,从而加快构建过程:
191+
192+
.. code-block:: bash
184193
185194
build-docs -t esp32 -l en build
186195
187-
如需深入了解 `esp-docs` 的功能,请参考 `esp-docs <https://docs.espressif.com/projects/esp-docs/en/latest/>`_。
196+
更多详细信息,请参阅 `esp-docs <https://docs.espressif.com/projects/esp-docs/en/latest/>`_。
188197

189198
小结
190199
------

0 commit comments

Comments
 (0)