Open Omegaki113r opened 1 month ago
From your config:
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
Anything 16kb or smaller will always attempt internal allocation first. You can reduce this further to shift some allocations over or you can specifically call the heap APIs to allocate with caps for PSRAM.
Answers checklist.
IDF version.
v5.3-beta1-108-gae876915ec
Espressif SoC revision.
ESP32-S3 (QFN56) (revision v0.1)
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-S3-WROOM-1
Power Supply used.
USB
What is the expected behavior?
I am developing a firmware that needs to use BLE, WIFI, Websocket client, websocket server, UART, CAN peripherals at the same time. Therefore i enabled PSRAM on the devkit i am using.
i have enabled following configs,
CONFIG_ESP32S3_SPIRAM_SUPPORT=y CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y
CONFIG_SPIRAM=y CONFIG_SPIRAM_MODE_QUAD=y CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y CONFIG_SPIRAM_CLK_IO=30 CONFIG_SPIRAM_CS_IO=26 CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y CONFIG_SPIRAM_RODATA=y CONFIG_SPIRAM_SPEED_40M=y CONFIG_SPIRAM_SPEED=40 CONFIG_SPIRAM_BOOT_INIT=y CONFIG_SPIRAM_USE_MALLOC=y CONFIG_SPIRAM_MEMTEST=y CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
So what my assumption was when i run my code it will use combination of both Internal and PSRAM. But i can only see my internal ram going down.
i am logging both internal and psram availability to terminal using,
printf("RAM INFORMATION %d %d\r\n", xPortGetFreeHeapSize(), heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
What is the actual behavior?
eventhough i have enabled the settings related to asking BLE, WiFi and mbedtls to use external ram, almost all the allocations done by ESPIDF seems to be done on internal memory.
Steps to reproduce.
CONFIG_ESP32S3_SPIRAM_SUPPORT=y CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y
CONFIG_SPIRAM=y CONFIG_SPIRAM_MODE_QUAD=y CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y CONFIG_SPIRAM_CLK_IO=30 CONFIG_SPIRAM_CS_IO=26 CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y CONFIG_SPIRAM_RODATA=y CONFIG_SPIRAM_SPEED_40M=y CONFIG_SPIRAM_SPEED=40 CONFIG_SPIRAM_BOOT_INIT=y CONFIG_SPIRAM_USE_MALLOC=y CONFIG_SPIRAM_MEMTEST=y CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
Debug Logs.
More Information.
No response