This article explains how to use the additional external RAM of the uPesy ESP32 Wrover Devkit board on the Arduino Framework and on the ESP-IDF Framework.
Presentation and utility¶
Since the internal RAM of the microcontrollers is quite low, an additional external RAM can be added. Even, if the ESP32 is a microcontroller that has a lot of RAM, it may not be sufficient, especially when you want to handle huge files like JSON, HTML …
- The PSRAM is an additional external RAM of 4 MB which is present in some ESP32 modules:
The ESP32 communicates with the PSRAM by SPI. This is why it is also called SPI RAM. The 3rd SPI bus of the ESP32 is used to communicate with the flash memory (which contains the program) and with the PSRAM.
There is an ambiguity about the amount of real memory in the PSRAM. The real size of the PSRAM (on the silicon chip) is not 4MB but 8MB.However, only 4MB can be easily accessed by the software. To use the 8 MB of PSRAM, it is quite complex Use 8 MB of PSRAM This said 4 MB more RAM is already huge (8 times the internal RAM)!
The advantage of an external RAM is to be able to relieve the internal RAM for the storage of important data. We can :
- We can for example:
Download large Json files
Store entire WEB pages
Make a powerful web server
Create huge arrays
Read and manipulate data from large files