feat(psram): Add unencrypted region for psram for esp32s31

This commit is contained in:
C.S.M
2026-07-07 10:42:45 +08:00
parent fbdf6d7427
commit 048b4dde0c
4 changed files with 27 additions and 1 deletions
@@ -19,6 +19,7 @@
#include "freertos/FreeRTOS.h"
#include "esp_heap_caps_init.h"
#include "esp_psram.h"
#include "esp_macros.h"
#include "esp_mmu_map.h"
#include "hal/mmu_hal.h"
#include "hal/mmu_ll.h"
@@ -288,7 +289,7 @@ static void s_psram_mapping(uint32_t psram_available_size, uint32_t start_page)
{
esp_err_t ret = ESP_FAIL;
#if CONFIG_SPIRAM_ENC_EXEMPT
size_t enc_exempt_size = ALIGN_UP_BY((size_t)CONFIG_SPIRAM_ENC_EXEMPT_SIZE * 1024, MMU_PAGE_SIZE);
size_t enc_exempt_size = ESP_ALIGN_UP((size_t)CONFIG_SPIRAM_ENC_EXEMPT_SIZE * 1024, MMU_PAGE_SIZE);
if (enc_exempt_size >= psram_available_size) {
ESP_EARLY_LOGE(TAG, "SPIRAM_ENC_EXEMPT_SIZE (%dKB) >= available PSRAM (%dKB); disabling carve-out",
(int)(enc_exempt_size / 1024), (int)(psram_available_size / 1024));