This may be a completely newbie question.
(1) I'm trying to use the 8M PSRAM as "normal" memory,
when I choose in IDF menuconfig to access the PSRAM via heap_caps_malloc -- I can see all 8M of it
but if I integrate into the memory map I can only see about 300K -- why is that and how can it be fixed?
(2) the reason that I want to integrate the PSRAM into the memory is because I want to have a large statically allocated DATA and BSS segments.
(3) a second problem that I have is that when I add a large BSS segments, the build complains of data segment overflow (dram0_0_seg)
In other worlds (and to avoid XY question, because I may be completely off direction) -- How can I run something like this code on the ESP32S-EYE with 8MB PSRAM?
Thank you!
Code: Select all
[code][Codebox=c file=minimal.c]
#include <stdio.h>
#include <inttypes.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_chip_info.h"
#include "esp_flash.h"
#include "esp_system.h"
char bss_seg[3*1024*1024];
char data_seg[2*1024*1024] = {0xA5};
int app_main(void)
{
printf("Minimal app main\n");
printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size());
for (int i = 10; i >= 0; i--) {
printf("Exit in %d seconds...\n", i);
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
printf("Exit now.\n");
fflush(stdout);
// avoid optimzing data out
return (bss_seg[1024] < data_seg[1024]) ;
}
[/Codebox]