mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(esp_hw_support): run ESP32-P4 PMA programming from IRAM
The bootloader locks PMA entries on core 0 only (PMA is per-hart), so core 1 applies its PMA configuration with effective writes. Executing that from flash momentarily makes the flash aperture non-cacheable while reprogramming its entry, which executes ciphertext with flash encryption enabled (illegal instruction -> CPU lockup).
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#define ALIGN_DOWN_TO_MMU_PAGE_SIZE(addr) ((addr) & ~((SOC_MMU_PAGE_SIZE) - 1))
|
||||
#define ALIGN_UP(addr, align) (((addr) + (align) - 1) & ~((align) - 1))
|
||||
|
||||
static void esp_cpu_configure_invalid_regions(void)
|
||||
NOINLINE_ATTR IRAM_ATTR static void esp_cpu_configure_invalid_regions(void)
|
||||
{
|
||||
const unsigned PMA_NONE = PMA_L | PMA_EN;
|
||||
__attribute__((unused)) const unsigned PMA_RW = PMA_L | PMA_EN | PMA_R | PMA_W;
|
||||
|
||||
Reference in New Issue
Block a user