Page 1 of 1

Only 4M PSRAM seen on N8R8 chip

Posted: Tue Jul 25, 2023 1:29 am
by davepl
I'm using a WROVER-E-N8R8 (8M flash, 8M PSRAM) on a custom PCB. The code manages to initialize PSRAM, but it only finds 4M, not 8M.

I'm using PlatformIO, though an Ardunio build. But the same code works on an 8M ESP32-S3 and reports 8M.

Is there anything special or particular I can or need to do for it to see the full 8M?

Thanks!
Dave

PS: This is the chip it's built with: https://jlcpcb.com/partdetail/3370765-E ... 8/C2973667

Code: Select all

    debugI("ESP32 PSRAM Init: %s", psramInit() ? "OK" : "FAIL");
    debugI("Version %u: Wifi SSID: \"%s\" - ESP32 Free Memory: %u, PSRAM:%u, PSRAM Free: %u",
            FLASH_VERSION, cszSSID, ESP.getFreeHeap(), ESP.getPsramSize(), ESP.getFreePsram());

Re: Only 4M PSRAM seen on N8R8 chip

Posted: Tue Jul 25, 2023 11:22 am
by ESP_igrr
Hi Dave,

ESP32 is limited to only 4 MB of address space for external RAM. With 8 MB PSRAM modules you can use "himem" API to do bank switching, which is one of the ways how you can access physical memory which is larger than the address space.

https://docs.espressif.com/projects/esp ... himem.html

(Newer chips, such as ESP32-S2 and -S3, can map larger amounts of PSRAM into the address space without the need for bank switching.)

Re: Only 4M PSRAM seen on N8R8 chip

Posted: Tue Jul 25, 2023 4:59 pm
by davepl
Thanks very much! I was confused by having seen the higher available counts on the S3 version, not realizing it's a significantly different chip!