External RAM enabled and performance tuning
Posted: Wed Sep 19, 2018 8:45 pm
I set my menuconfig.
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL = 4096
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
CONFIG_SPIRAM_USE_MALLOC=y
Once internal ram free is less than 50768 than all allocation using new/alloc will start happening from external ram.
As I understood. I need to keep 50-60 k internal ram always free to be used by Wifi module.
Option #1
I am using standard alloc and new.
As I understood. Any ram buffer allocation more than 4k will be allocated from external ram always. less than on internal ram.
I reserve my internal ram minimum free space= 50768 to be used Wifi and other system libraries. I guess used by mongoose networking libraries for tcp/udp connections.
My free internal ram stats shows that free internal ram still 80k. which is good for WIFI
Option # 2
I am trying to avoid explicit malloc calls heap_caps_malloc(size, MALLOC_CAP_SPIRAM) or internal.
I did try it. I found that after my firmware/application starts. It do ram free stats. It is showing that internal ram left is about 50k.
not much. If I starts web server and open my website with some files gets read from sd card which is about 2.3 Mb. It consume internal ram during reading SD card. My internal ram goes down to 40k and Wifi stop working.
I am looking to use Option #1
Is this good settings and options to be used. i have wifi with its own access point and STA.
I am using mongoose web server as well be some TCP, UDP sockets.
CAN driver also used to send and receive messages. SD card also used to read/write with Mongoose Http Web server
Do suggest any tuning for optimal performance.
All my Tasks /Threads are running on CPU1. CPU0 is assigned for Wifi.
Thanks,
Naeem.
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL = 4096
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
CONFIG_SPIRAM_USE_MALLOC=y
Once internal ram free is less than 50768 than all allocation using new/alloc will start happening from external ram.
As I understood. I need to keep 50-60 k internal ram always free to be used by Wifi module.
Option #1
I am using standard alloc and new.
As I understood. Any ram buffer allocation more than 4k will be allocated from external ram always. less than on internal ram.
I reserve my internal ram minimum free space= 50768 to be used Wifi and other system libraries. I guess used by mongoose networking libraries for tcp/udp connections.
My free internal ram stats shows that free internal ram still 80k. which is good for WIFI
Option # 2
I am trying to avoid explicit malloc calls heap_caps_malloc(size, MALLOC_CAP_SPIRAM) or internal.
I did try it. I found that after my firmware/application starts. It do ram free stats. It is showing that internal ram left is about 50k.
not much. If I starts web server and open my website with some files gets read from sd card which is about 2.3 Mb. It consume internal ram during reading SD card. My internal ram goes down to 40k and Wifi stop working.
I am looking to use Option #1
Is this good settings and options to be used. i have wifi with its own access point and STA.
I am using mongoose web server as well be some TCP, UDP sockets.
CAN driver also used to send and receive messages. SD card also used to read/write with Mongoose Http Web server
Do suggest any tuning for optimal performance.
All my Tasks /Threads are running on CPU1. CPU0 is assigned for Wifi.
Thanks,
Naeem.