Merge branch 'bugfix/release_some_memory_on_single_core_mode' into 'master'

release memory not used in single core mode

See merge request idf/esp-idf!2733
This commit is contained in:
Jiang Jiang Jian 2018-10-30 15:53:31 +08:00
commit 97e3542947
5 changed files with 22 additions and 18 deletions

View File

@ -61,7 +61,9 @@ static void select_rtc_slow_clk(slow_clk_sel_t slow_clk);
// g_ticks_us defined in ROMs for PRO and APP CPU
extern uint32_t g_ticks_per_us_pro;
#ifndef CONFIG_FREERTOS_UNICORE
extern uint32_t g_ticks_per_us_app;
#endif
static const char* TAG = "clk";
@ -155,7 +157,9 @@ void IRAM_ATTR ets_update_cpu_frequency(uint32_t ticks_per_us)
{
/* Update scale factors used by ets_delay_us */
g_ticks_per_us_pro = ticks_per_us;
#ifndef CONFIG_FREERTOS_UNICORE
g_ticks_per_us_app = ticks_per_us;
#endif
}
static void select_rtc_slow_clk(slow_clk_sel_t slow_clk)

View File

@ -361,7 +361,6 @@ void start_cpu0_default(void)
#endif
esp_cache_err_int_init();
esp_crosscore_int_init();
esp_ipc_init();
#ifndef CONFIG_FREERTOS_UNICORE
esp_dport_access_int_init();
#endif

View File

@ -33,21 +33,6 @@ typedef void (*esp_ipc_func_t)(void* arg);
* These APIs can only be used when FreeRTOS scheduler is running.
*/
/*
* Initialize inter-processor call module. This function is called automatically
* on CPU start and should not be called from the application.
*
* This function start two tasks, one on each CPU. These tasks are started
* with high priority. These tasks are normally inactive, waiting until one of
* the esp_ipc_call_* functions to be used. One of these tasks will be
* woken up to execute the callback provided to esp_ipc_call_nonblocking or
* esp_ipc_call_blocking.
*/
/** @cond */
void esp_ipc_init();
/** @endcond */
/**
* @brief Execute a function on the given CPU
*

View File

@ -72,7 +72,19 @@ static void IRAM_ATTR ipc_task(void* arg)
vTaskDelete(NULL);
}
void esp_ipc_init()
/*
* Initialize inter-processor call module. This function is called automatically
* on CPU start and should not be called from the application.
*
* This function start two tasks, one on each CPU. These tasks are started
* with high priority. These tasks are normally inactive, waiting until one of
* the esp_ipc_call_* functions to be used. One of these tasks will be
* woken up to execute the callback provided to esp_ipc_call_nonblocking or
* esp_ipc_call_blocking.
*/
static void esp_ipc_init() __attribute__((constructor));
static void esp_ipc_init()
{
s_ipc_mutex = xSemaphoreCreateMutex();
s_ipc_ack = xSemaphoreCreateBinary();

View File

@ -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);