Add logic to make external RAM usable with malloc()

This commit is contained in:
Jeroen Domburg
2017-09-22 16:02:39 +08:00
parent c65f12bb45
commit 740f8a79f0
20 changed files with 364 additions and 51 deletions

View File

@@ -262,6 +262,16 @@ void start_cpu0_default(void)
ESP_EARLY_LOGE(TAG, "External RAM could not be added to heap!");
abort();
}
#if CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL
r=esp_spiram_reserve_dma_pool(CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL);
if (r != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Could not reserve internal/DMA pool!");
abort();
}
#endif
#if CONFIG_SPIRAM_USE_MALLOC
heap_caps_malloc_extmem_enable(CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL);
#endif
#endif
//Enable trace memory and immediately start trace.