mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(MMU): fixed mmap deadlock when using multicore app with unicore bootloader
Closes https://github.com/espressif/esp-idf/issues/11617
This commit is contained in:
parent
1bb33a31b8
commit
52066307ed
@ -315,6 +315,17 @@ static void start_other_core(void)
|
||||
}
|
||||
|
||||
#if !SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
static void restore_app_mmu_from_pro_mmu(void)
|
||||
{
|
||||
const int mmu_reg_num = 2048;
|
||||
volatile uint32_t* from = (uint32_t*)DR_REG_FLASH_MMU_TABLE_PRO;
|
||||
volatile uint32_t* to = (uint32_t*)DR_REG_FLASH_MMU_TABLE_APP;
|
||||
for (int i = 0; i < mmu_reg_num; i++) {
|
||||
*(to++) = *(from++);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// This function is needed to make the multicore app runnable on a unicore bootloader (built with FREERTOS UNICORE).
|
||||
// It does some cache settings for other CPUs.
|
||||
void IRAM_ATTR do_multicore_settings(void)
|
||||
@ -326,9 +337,11 @@ void IRAM_ATTR do_multicore_settings(void)
|
||||
Cache_Read_Disable(1);
|
||||
Cache_Flush(1);
|
||||
DPORT_REG_SET_BIT(DPORT_APP_CACHE_CTRL1_REG, DPORT_APP_CACHE_MMU_IA_CLR);
|
||||
mmu_init(1);
|
||||
DPORT_REG_CLR_BIT(DPORT_APP_CACHE_CTRL1_REG, DPORT_APP_CACHE_MMU_IA_CLR);
|
||||
// We do not enable cache for CPU1 now because it will be done later in start_other_core().
|
||||
}
|
||||
restore_app_mmu_from_pro_mmu();
|
||||
#endif
|
||||
|
||||
cache_bus_mask_t cache_bus_mask_core0 = cache_ll_l1_get_enabled_bus(0);
|
||||
|
Loading…
Reference in New Issue
Block a user