diff --git a/docs/en/api-guides/external-ram.rst b/docs/en/api-guides/external-ram.rst index 395fc0dc76a..9f6a2a9017d 100644 --- a/docs/en/api-guides/external-ram.rst +++ b/docs/en/api-guides/external-ram.rst @@ -271,7 +271,7 @@ By default, failure to initialize external RAM will cause the ESP-IDF startup to ``MALLOC_CAP_SPIRAM_NO_ENC`` must be requested explicitly. It is intentionally not combined with ``MALLOC_CAP_SPIRAM`` or ``MALLOC_CAP_DEFAULT``, so ordinary SPIRAM/heap allocations cannot accidentally land in the unencrypted region. - To verify after the fact that a buffer was allocated from the unencrypted carve-out (for example after a ``heap_caps_malloc_prefer()`` call that may have fallen back to encrypted PSRAM), use :cpp:func:`esp_psram_ptr_is_no_enc`. + To verify after the fact that a buffer was allocated from the unencrypted carve-out (for example after a ``heap_caps_malloc_prefer()`` call that may have fallen back to encrypted PSRAM), use ``esp_psram_ptr_is_no_enc()``. .. only:: SOC_PSRAM_ENCRYPTION_SEPARATE_KEY diff --git a/docs/zh_CN/api-guides/external-ram.rst b/docs/zh_CN/api-guides/external-ram.rst index cee4135a4b9..6087b7547f1 100644 --- a/docs/zh_CN/api-guides/external-ram.rst +++ b/docs/zh_CN/api-guides/external-ram.rst @@ -252,7 +252,7 @@ ESP-IDF 启动过程中,片外 RAM 被映射到数据虚拟地址空间,该 预留未加密的 PSRAM 区域 ----------------------- - 启用 :ref:`CONFIG_SPIRAM_ENC_EXEMPT` 会在 PSRAM 顶部预留一段区域(大小由 :ref:`CONFIG_SPIRAM_ENC_EXEMPT_SIZE` 指定,单位为 KB,向上取整到 MMU 页面大小),该区域在映射时不启用加密。此区域被注册为一个独立的堆池,仅可通过 ``MALLOC_CAP_SPIRAM_NO_ENC`` 能力位访问。其余 PSRAM(以及 flash)仍然保持加密。 + 启用 :ref:`CONFIG_SPIRAM_ENC_EXEMPT` 会在 PSRAM 上端(最高物理地址区,大小由 :ref:`CONFIG_SPIRAM_ENC_EXEMPT_SIZE` 指定,单位为 KB,向上取整到 MMU 页面大小)预留一段区域,该区域在映射时不启用加密。此区域被注册为一个独立的堆池,仅可通过 ``MALLOC_CAP_SPIRAM_NO_ENC`` 能力位访问。其余 PSRAM(以及 flash)仍然保持加密。 .. warning:: @@ -271,6 +271,8 @@ ESP-IDF 启动过程中,片外 RAM 被映射到数据虚拟地址空间,该 必须显式请求 ``MALLOC_CAP_SPIRAM_NO_ENC``。该能力位有意未与 ``MALLOC_CAP_SPIRAM`` 或 ``MALLOC_CAP_DEFAULT`` 组合,因此普通 SPIRAM/堆分配不会意外落入该未加密区域。 + 如需在分配后验证缓冲区是否确实位于未加密的预留区域(例如调用 ``heap_caps_malloc_prefer()`` 后可能回退到加密的 PSRAM),可使用 ``esp_psram_ptr_is_no_enc()``。 + .. only:: SOC_PSRAM_ENCRYPTION_SEPARATE_KEY 在 {IDF_TARGET_NAME} 上,PSRAM 加密可以使用独立的加密密钥。如果未烧录 PSRAM 加密密钥,则会使用 flash 加密密钥作为 PSRAM 加密密钥。