From 2efd6859ed69acc83ec125b47406132478a57547 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 9 Jul 2018 17:15:22 +0800 Subject: [PATCH] release memory not used in single core mode 1. do not start ipc task in single core mode 2. do not use APP cpu cache memory in single core mode 3. relase data used in rom by APP cpu --- components/esp32/cpu_start.c | 2 +- components/soc/esp32/soc_memory_layout.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index bda8b8cc82..634a63eb0a 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -350,8 +350,8 @@ void start_cpu0_default(void) #endif esp_cache_err_int_init(); esp_crosscore_int_init(); - esp_ipc_init(); #ifndef CONFIG_FREERTOS_UNICORE + esp_ipc_init(); esp_dport_access_int_init(); #endif spi_flash_init(); diff --git a/components/soc/esp32/soc_memory_layout.c b/components/soc/esp32/soc_memory_layout.c index c6fa4635d2..de884cd45c 100644 --- a/components/soc/esp32/soc_memory_layout.c +++ b/components/soc/esp32/soc_memory_layout.c @@ -131,7 +131,9 @@ const size_t soc_memory_region_count = sizeof(soc_memory_regions)/sizeof(soc_mem These are removed from the soc_memory_regions array when heaps are created. */ SOC_RESERVE_MEMORY_REGION(0x40070000, 0x40078000, cpu0_cache); +#ifndef CONFIG_FREERTOS_UNICORE SOC_RESERVE_MEMORY_REGION(0x40078000, 0x40080000, cpu1_cache); +#endif /* Warning: The ROM stack is located in the 0x3ffe0000 area. We do not specifically disable that area here because after the scheduler has started, the ROM stack is not used anymore by anything. We handle it instead by not allowing @@ -150,7 +152,9 @@ SOC_RESERVE_MEMORY_REGION(0x40078000, 0x40080000, cpu1_cache); */ SOC_RESERVE_MEMORY_REGION(0x3ffe0000, 0x3ffe0440, rom_pro_data); //Reserve ROM PRO data region -SOC_RESERVE_MEMORY_REGION(0x3ffe4000, 0x3ffe4350, rom_app_data); //Reserve ROM APP data region +#ifndef CONFIG_FREERTOS_UNICORE +SOC_RESERVE_MEMORY_REGION(0x3ffe3f20, 0x3ffe4350, rom_app_data); //Reserve ROM APP data region +#endif SOC_RESERVE_MEMORY_REGION(0x3ffae000, 0x3ffae6e0, rom_data);