mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 23:54:33 +02:00
Merge branch 'docs/update_CN_trans_api-guides' into 'master'
docs: updated CN trans for linker-script-generation and external-ram Closes DOC-2803 See merge request espressif/esp-idf!17510
This commit is contained in:
@@ -71,6 +71,7 @@ Placing object files
|
|||||||
""""""""""""""""""""
|
""""""""""""""""""""
|
||||||
|
|
||||||
Suppose the entirety of ``my_src1.o`` is performance-critical, so it is desirable to place it in RAM. On the other hand, the entirety of ``my_src2.o`` contains symbols needed coming out of deep sleep, so it needs to be put under RTC memory.
|
Suppose the entirety of ``my_src1.o`` is performance-critical, so it is desirable to place it in RAM. On the other hand, the entirety of ``my_src2.o`` contains symbols needed coming out of deep sleep, so it needs to be put under RTC memory.
|
||||||
|
|
||||||
In the linker fragment file, we can write:
|
In the linker fragment file, we can write:
|
||||||
|
|
||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
|
@@ -137,12 +137,18 @@ ESP-IDF 启动过程中,片外 RAM 被映射到以 {IDF_TARGET_PSRAM_ADDR_STAR
|
|||||||
|
|
||||||
* 片外 RAM 与片外 flash 使用相同的 cache 区域,这意味着频繁在片外 RAM 访问的变量可以像在片上 RAM 中一样快速读取和修改。但访问大块数据时(大于 32 KB),cache 空间可能会不足,访问速度将回落到片外 RAM 访问速度。此外,访问大块数据会挤出 flash cache,可能降低代码执行速度。
|
* 片外 RAM 与片外 flash 使用相同的 cache 区域,这意味着频繁在片外 RAM 访问的变量可以像在片上 RAM 中一样快速读取和修改。但访问大块数据时(大于 32 KB),cache 空间可能会不足,访问速度将回落到片外 RAM 访问速度。此外,访问大块数据会挤出 flash cache,可能降低代码执行速度。
|
||||||
|
|
||||||
* 一般来说,片外 RAM 不可用作任务堆栈存储器。因此 :cpp:func:`xTaskCreate` 及类似函数将始终为堆栈和任务 TCB 分配片上储存器,而 :cpp:func:`xTaskCreateStatic` 类型的函数将检查传递的 Buffer 是否属于片上存储器。
|
* 一般来说,片外 RAM 不会用作任务堆栈存储器。:cpp:func:`xTaskCreate` 及类似函数始终会为堆栈和任务 TCB 分配片上储存器。
|
||||||
|
|
||||||
.. only:: esp32
|
.. only:: esp32
|
||||||
|
|
||||||
可以使用 :ref:`CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` 选项将任务堆栈放入片外存储器。这时,必须使用 :cpp:func:`xTaskCreateStatic` 指定从片外存储器分配的任务堆栈缓冲区,否则任务堆栈将会从片上存储器分配。
|
可以使用 :ref:`CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` 选项将任务堆栈放入片外存储器。这时,必须使用 :cpp:func:`xTaskCreateStatic` 指定从片外存储器分配的任务堆栈缓冲区,否则任务堆栈将会从片上存储器分配。
|
||||||
|
|
||||||
|
|
||||||
|
.. only:: not esp32
|
||||||
|
|
||||||
|
可以使用 :cpp:func:`xTaskCreateStatic` 显式地将任务堆栈放入片外存储器。
|
||||||
|
|
||||||
|
|
||||||
初始化失败
|
初始化失败
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
|
@@ -71,6 +71,7 @@
|
|||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
假设整个 ``my_src1.o`` 目标文件对性能至关重要,所以最好把该文件放在 RAM 中。另外,``my_src2.o`` 目标文件包含从深度睡眠唤醒所需的符号,因此需要将其存放到 RTC 存储器中。
|
假设整个 ``my_src1.o`` 目标文件对性能至关重要,所以最好把该文件放在 RAM 中。另外,``my_src2.o`` 目标文件包含从深度睡眠唤醒所需的符号,因此需要将其存放到 RTC 存储器中。
|
||||||
|
|
||||||
在链接器片段文件中可以写入以下内容:
|
在链接器片段文件中可以写入以下内容:
|
||||||
|
|
||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
@@ -125,6 +126,7 @@
|
|||||||
entries:
|
entries:
|
||||||
* (rtc)
|
* (rtc)
|
||||||
|
|
||||||
|
|
||||||
.. _ldgen-conditional-placements :
|
.. _ldgen-conditional-placements :
|
||||||
|
|
||||||
根据具体配置存放
|
根据具体配置存放
|
||||||
@@ -227,8 +229,8 @@
|
|||||||
- 名称:片段名称,指定片段类型的片段名称应唯一。
|
- 名称:片段名称,指定片段类型的片段名称应唯一。
|
||||||
- 键值:片段内容。每个片段类型可支持不同的键值和不同的键值语法。
|
- 键值:片段内容。每个片段类型可支持不同的键值和不同的键值语法。
|
||||||
|
|
||||||
- 在 ``段`` 和 ``协议`` 中,仅支持 ``entries`` 键。
|
- 在 :ref:`段 <ldgen-sections-fragment>` 和 :ref:`协议 <ldgen-scheme-fragment>` 中,仅支持 ``entries`` 键。
|
||||||
- 在 ``映射`` 中,键支持 ``archive`` 和 ``entries``。
|
- 在 :ref:`映射 <ldgen-mapping-fragment>` 中,支持 ``archive`` 和 ``entries`` 键。
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -473,7 +475,7 @@
|
|||||||
# 注意
|
# 注意
|
||||||
# A. entity-scheme 后使用分号
|
# A. entity-scheme 后使用分号
|
||||||
# B. section2 -> target2 前使用逗号
|
# B. section2 -> target2 前使用逗号
|
||||||
# C. 在 scheme1 条目中 定义 section1 -> target1 和 section2 -> target2
|
# C. 在 scheme1 条目中定义 section1 -> target1 和 section2 -> target2
|
||||||
entity1 (scheme1);
|
entity1 (scheme1);
|
||||||
section1 -> target1 KEEP() ALIGN(4, pre, post),
|
section1 -> target1 KEEP() ALIGN(4, pre, post),
|
||||||
section2 -> target2 SURROUND(sym) ALIGN(4, post) SORT()
|
section2 -> target2 SURROUND(sym) ALIGN(4, post) SORT()
|
||||||
|
Reference in New Issue
Block a user