diff --git a/components/bootloader/subproject/main/ld/esp32c6/bootloader.ld b/components/bootloader/subproject/main/ld/esp32c6/bootloader.ld index 8922baf6ce..412214031f 100644 --- a/components/bootloader/subproject/main/ld/esp32c6/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32c6/bootloader.ld @@ -24,7 +24,7 @@ bootloader_usable_dram_end = 0x4087c610; bootloader_stack_overhead = 0x2000; /* For safety margin between bootloader data section and startup stacks */ bootloader_dram_seg_len = 0x5000; bootloader_iram_loader_seg_len = 0x7000; -bootloader_iram_seg_len = 0x2100; +bootloader_iram_seg_len = 0x2200; /* Start of the lower region is determined by region size and the end of the higher region */ bootloader_dram_seg_end = bootloader_usable_dram_end - bootloader_stack_overhead; diff --git a/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c b/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c index fc2ecc3863..6087afebc7 100644 --- a/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c +++ b/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c @@ -40,6 +40,7 @@ #include "esp_private/bootloader_flash_internal.h" #include "esp_efuse.h" #include "hal/mmu_hal.h" +#include "hal/mmu_ll.h" #include "hal/cache_hal.h" #include "hal/clk_tree_ll.h" #include "soc/lp_wdt_reg.h" @@ -170,6 +171,8 @@ esp_err_t bootloader_init(void) cache_hal_init(); //reset mmu mmu_hal_init(); + // config mmu page size + mmu_ll_set_page_size(0, SPI_FLASH_MMU_PAGE_SIZE); // update flash ID bootloader_flash_update_id(); // Check and run XMC startup flow diff --git a/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c b/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c index ff24bec539..a48149be9e 100644 --- a/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c +++ b/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c @@ -40,6 +40,7 @@ #include "esp_private/bootloader_flash_internal.h" #include "esp_efuse.h" #include "hal/mmu_hal.h" +#include "hal/mmu_ll.h" #include "hal/cache_hal.h" #include "soc/lp_wdt_reg.h" #include "hal/efuse_hal.h" @@ -160,7 +161,8 @@ esp_err_t bootloader_init(void) cache_hal_init(); //reset mmu mmu_hal_init(); - + // config mmu page size + mmu_ll_set_page_size(0, SPI_FLASH_MMU_PAGE_SIZE); // update flash ID bootloader_flash_update_id(); // Check and run XMC startup flow diff --git a/components/soc/Kconfig b/components/soc/Kconfig index 26e916a637..8d7c21cf60 100644 --- a/components/soc/Kconfig +++ b/components/soc/Kconfig @@ -9,12 +9,12 @@ menu "SoC Settings" config MMU_PAGE_SIZE_16KB bool - default y if IDF_TARGET_ESP32C2 && ESPTOOLPY_FLASHSIZE_1MB + default y if SOC_MMU_PAGE_SIZE_CONFIGURABLE && ESPTOOLPY_FLASHSIZE_1MB default n config MMU_PAGE_SIZE_32KB bool - default y if IDF_TARGET_ESP32C2 && ESPTOOLPY_FLASHSIZE_2MB + default y if SOC_MMU_PAGE_SIZE_CONFIGURABLE && ESPTOOLPY_FLASHSIZE_2MB default n config MMU_PAGE_SIZE_64KB