Skip to content

Commit 37a4de8

Browse files
committed
Merge branch 'fix/incorrect_calculation_of_used_xip_pages' into 'master'
fix(esp_psram): Fix incorrect calculation of used XIP PSRAM pages See merge request espressif/esp-idf!37069
2 parents 0d6b29c + a1e6387 commit 37a4de8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

components/esp_psram/mmu_psram_flash_v2.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -111,8 +111,7 @@ esp_err_t mmu_config_psram_text_segment(uint32_t start_page, uint32_t psram_size
111111

112112
ESP_EARLY_LOGV(TAG, "after mapping text, starting from paddr=0x%08"PRIx32" and vaddr=0x%08"PRIx32", 0x%"PRIx32" bytes are mapped", MMU_PAGE_TO_BYTES(start_page), irom_load_addr_aligned, mapped_size);
113113

114-
start_page += BYTES_TO_MMU_PAGE(irom_size);
115-
*out_page = start_page;
114+
*out_page = BYTES_TO_MMU_PAGE(irom_size);
116115

117116
ESP_EARLY_LOGI(TAG, ".text xip on psram");
118117
return ESP_OK;
@@ -147,8 +146,7 @@ esp_err_t mmu_config_psram_rodata_segment(uint32_t start_page, uint32_t psram_si
147146

148147
ESP_EARLY_LOGV(TAG, "after mapping rodata, starting from paddr=0x%08"PRIx32" and vaddr=0x%08"PRIx32", 0x%"PRIx32" bytes are mapped", MMU_PAGE_TO_BYTES(start_page), drom_load_addr_aligned, mapped_size);
149148

150-
start_page += BYTES_TO_MMU_PAGE(drom_size);
151-
*out_page = start_page;
149+
*out_page = BYTES_TO_MMU_PAGE(drom_size);
152150

153151
ESP_EARLY_LOGI(TAG, ".rodata xip on psram");
154152
return ESP_OK;

0 commit comments

Comments
 (0)