From ca480e01990a03c1486b399f0cee5f482c42ef2a Mon Sep 17 00:00:00 2001 From: "harshal.patil" Date: Tue, 28 Apr 2026 18:12:11 +0530 Subject: [PATCH] fix(esp_hw_support): reset stale PMP gap entries on P4 v3 before app memprot setup --- .../esp_hw_support/port/esp32p4/cpu_region_protect.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/esp_hw_support/port/esp32p4/cpu_region_protect.c b/components/esp_hw_support/port/esp32p4/cpu_region_protect.c index ffafdbc821e..f36528479cf 100644 --- a/components/esp_hw_support/port/esp32p4/cpu_region_protect.c +++ b/components/esp_hw_support/port/esp32p4/cpu_region_protect.c @@ -153,6 +153,17 @@ static void esp_cpu_configure_region_protection_rev_v3(void) const uint32_t page_aligned_irom_resv_end = ALIGN_UP_TO_MMU_PAGE_SIZE((uint32_t)(&_instruction_reserved_end)); __attribute__((unused)) const uint32_t page_aligned_drom_resv_end = ALIGN_UP_TO_MMU_PAGE_SIZE((uint32_t)(&_rodata_reserved_end)); + PMP_ENTRY_CFG_RESET(11); + PMP_ENTRY_CFG_RESET(12); + PMP_ENTRY_CFG_RESET(13); + PMP_ENTRY_CFG_RESET(14); + PMP_ENTRY_CFG_RESET(15); + PMP_ENTRY_CFG_RESET(16); + PMP_ENTRY_CFG_RESET(17); + PMP_ENTRY_CFG_RESET(18); + PMP_ENTRY_CFG_RESET(19); + PMP_ENTRY_CFG_RESET(23); + // 6. I_EXTRAM / D_EXTRAM (SPIRAM) #if CONFIG_SPIRAM && CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION