docs(esp_psram): clarify carve-out location is at upper end of PSRAM

The previous wording "top of PSRAM" was ambiguous: the carve-out is
actually mapped at the highest physical addresses of PSRAM (after the
rodata, text, and main heap mappings). Update the Kconfig help text for
SPIRAM_ENC_EXEMPT and SPIRAM_ENC_EXEMPT_SIZE, the External RAM
documentation, and the internal layout comment to say "upper end of PSRAM
(highest physical addresses)" instead.
This commit is contained in:
Mahavir Jain
2026-05-21 20:54:31 +05:30
parent ef7192fc73
commit 77e85b886a
3 changed files with 8 additions and 6 deletions
+6 -4
View File
@@ -164,8 +164,9 @@ config SPIRAM_ENC_EXEMPT
help
!!! SECURITY WARNING !!!
Enabling this option carves out a region at the top of PSRAM that is mapped
WITHOUT encryption, even when flash encryption is enabled. Memory allocated
Enabling this option carves out a region at the upper end of PSRAM (highest
physical addresses) that is mapped WITHOUT encryption, even when flash
encryption is enabled. Memory allocated
from this region (via MALLOC_CAP_SPIRAM_NO_ENC) is stored in plaintext in
PSRAM and can be observed by an attacker with physical access to the PSRAM
interface.
@@ -189,7 +190,8 @@ config SPIRAM_ENC_EXEMPT_SIZE
range 64 65536
depends on SPIRAM_ENC_EXEMPT
help
Size of the PSRAM region carved out at the top of PSRAM and mapped without
encryption. Rounded up to a multiple of the MMU page size (typically 64 KB).
Size of the PSRAM region carved out at the upper end of PSRAM (highest
physical addresses) and mapped without encryption. Rounded up to a multiple
of the MMU page size (typically 64 KB).
The region is registered as a separate heap pool, accessible only via
MALLOC_CAP_SPIRAM_NO_ENC.
@@ -52,7 +52,7 @@
* PSRAM memory regions:
* - 8bit aligned
* - 32bit aligned
* - Optional: encryption-exempt carve-out (top of PSRAM)
* - Optional: encryption-exempt carve-out (upper end of PSRAM, highest physical addresses)
*/
#define PSRAM_MEM_8BIT_ALIGNED 0
#define PSRAM_MEM_32BIT_ALIGNED 1
+1 -1
View File
@@ -252,7 +252,7 @@ By default, failure to initialize external RAM will cause the ESP-IDF startup to
Reserving an Unencrypted PSRAM Region
-------------------------------------
Enabling :ref:`CONFIG_SPIRAM_ENC_EXEMPT` reserves a region at the top of PSRAM (sized by :ref:`CONFIG_SPIRAM_ENC_EXEMPT_SIZE`, in KB, rounded up to the MMU page size) that is mapped without encryption. This region is registered as a separate heap pool reachable only via the ``MALLOC_CAP_SPIRAM_NO_ENC`` capability. The rest of PSRAM (and flash) remains encrypted.
Enabling :ref:`CONFIG_SPIRAM_ENC_EXEMPT` reserves a region at the upper end of PSRAM (highest physical addresses; sized by :ref:`CONFIG_SPIRAM_ENC_EXEMPT_SIZE`, in KB, rounded up to the MMU page size) that is mapped without encryption. This region is registered as a separate heap pool reachable only via the ``MALLOC_CAP_SPIRAM_NO_ENC`` capability. The rest of PSRAM (and flash) remains encrypted.
.. warning::