Chapter 4. Software framework
When using ESP32 modules, how to check the size of their PSRAM?
For ESP32 modules, the
a module's PSRAM. This function returns the total size of the PSRAM in bytes and can be used for
memory allocation and management.
The following is an example for obtaining the size of PSRAM:
size_t
psram_size
printf("PSRAM size: %d
Note that the esp_spiram_get_size() function should be called before using the PSRAM to ensure the
correct PSRAM size can be obtained. Additionally, PSRAM functionality should be enabled in make
menuconfig, so that PSRAM can be used and configured. Furthermore, the PSRAM size can also
be obtained in the bootloader log.
When ESP32 connected to a PSRAM externally, how to change its clock source?
In menuconfig: menuconfig -> Component config -> ESP32-specific -> SPI RAM config.
When a 8 MB PSRAM mounted on ESP32, why only 4 MB of it is actually mapped?
• Up to 4 MB (0x3F80_0000 ~ 0x3FBF_FFFF) of external RAM can be mapped into data address space, please
refer to the specifications of Section 3.1.4 Memory Map in
• For a 8 MB PSRAM, you can access the other 4 MB following example himem.
I'm using an ESP32 development board with the official PSRAM chip PSRAM64H embedded. But after
replacing another type of PSRAM chip to PSRAM64H, it failed to recognize when I ran an ESP-IDF example
and enabled the PSRAM configuration. What is the reason?
• If you need to change the PSRAM chip, please update configuration options in "menuconfig -> Component
config -> ESP32-specific -> Support for external, SPI-connected RAM -> SPI RAM config -> Type of SPI
RAM chip in use".
• If you cannot find the corresponding type options of the new PSRAM chip you are about to use, please add
the chip driver manually.
• It is recommended to use Espressif's official ESP-PSRAM chip for ESP32 series.
Why is the following error printed when I download the hello-world example into the ESP32-WROOM-32E
module?
E (225)
psram:
E (225)
spiram:
The reason for the error is that the PSRAM (Component config > ESP32-specific > Sup-
port for external, SPI-connected RAM) setting is enabled in the software, but there is
no PSRAM support in the hardware.
Espressif Systems
esp_spiram_get_size()
=
esp_spiram_get_size();
bytes\n", psram_size);
PSRAM ID read
error:
SPI RAM enabled but initialization failed. Bailing out.
Submit Document Feedback
function in ESP-IDF can be used to obtain the size of
ESP32
Datasheet.
0xffffffff
112
Release master
Need help?
Do you have a question about the ESP and is the answer not in the manual?