PSRAM ESP32 (esp idf)

mohasrj
Posts: 33
Joined: Mon Jan 20, 2020 9:38 am

PSRAM ESP32 (esp idf)

Postby mohasrj » Fri Nov 27, 2020 4:58 pm

hi everyone ,

i work in application application esp32 framework esp idf V4.1 and module WROVER-B, i use LVGL library in my code

https://github.com/lvgl/lv_port_esp32


its use a lot of STATIC DRAM and ISRAM ( 2 buffer 40Kbytes for each ) so iam a 90% of my DRAM

using external PSRAM we have 3 option :

1-Integrate RAM into the ESP32 memory map
2-Add external RAM to the capability allocator
3-Provide external RAM via malloc() (default)


for the first one is good but i need do all management of the external SPI RAM: coordinating buffer usage, preventing corruption, etc.
so iam using 3rd option i add 4mo ram in malloc that work good but i dont know if can use it at same time to store static buffer like 80Kbyte and it will free some internal ram .... and what is fonction used for static variable


best regard ,

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: PSRAM ESP32 (esp idf)

Postby ESP_igrr » Sat Nov 28, 2020 9:48 pm

Hi mohasrj,
To place static data into PSRAM, you can enable CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY option in menuconfig, and then declare your variable with EXT_RAM_ATTR attribute.

mohasrj
Posts: 33
Joined: Mon Jan 20, 2020 9:38 am

Re: PSRAM ESP32 (esp idf)

Postby mohasrj » Mon Nov 30, 2020 8:26 am

hi @ESP_igrr,

Yes, that work well thanks now iam at :

Used static DRAM: 62664 bytes ( 118072 available, 34.7% used)
Used static IRAM: 122746 bytes ( 8326 available, 93.6% used)

so there is another methode de reduces IRAM ?

best regard !

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: PSRAM ESP32 (esp idf)

Postby ESP_igrr » Tue Dec 01, 2020 7:31 am

Could you post your sdkconfig file, please?

mohasrj
Posts: 33
Joined: Mon Jan 20, 2020 9:38 am

Re: PSRAM ESP32 (esp idf)

Postby mohasrj » Thu Dec 03, 2020 9:12 am

hi @ESP_igrr

yes of course i add it in attachments text file,
Attachments
sdkconfig.txt
(56.57 KiB) Downloaded 493 times

Who is online

Users browsing this forum: No registered users and 104 guests