I have been trying to use an external PSRAM along with esp32 U4WDH. The PSRAM I am using is from espressif itself.
I have used the data pins as;
(These pin configurations are shown in the esp32 datasheet, I have tried both configurations and none of them can detect PSRAM)
SD_DATA_1 - SIO0/SI
GPIO17 - SIO1/SO
SD_DATA_0 - SIO2
SD_CMD - SIO3
SD_CLK - CLK
GPIO10 - CS#
GND - VSS
VDD_SDIO - VDD
SD_DATA_1 - SIO0/SI
SD_DATA_0 - SIO1/SO
SD_DATA_3 - SIO2
SD_DATA_2 - SIO3
SD_CLK - SCLK
GPIO10 - CE#
GND - VSS
VDD_SDIO - VDD
The embedded flash used in U4WDH has the same data pins and CLK pin.
I am using Arduino IDE for this. I have chosen "ESP32 Dev Module" as my board type and I have enabled the PSRAM via the Tools menu.
The code with which I am trying to detect and get the size of PSRAM is;
[Codebox]
- #include <SPI.h>
- #include <Arduino.h>
- #include<esp32-hal.h>
- void setup() {
- Serial.begin(115200);
- //delay(2000);
- // pinMode(3,OUTPUT);
- // delay(200);
- //
- // digitalWrite(3,HIGH);
- // delay(500);
- Serial.print("Total heap:");
- Serial.println(ESP.getHeapSize());
- Serial.print("Free heap: ");
- Serial.println(ESP.getFreeHeap());
- // Serial.print("TOtal psram size : ");
- // Serial.println(esp_spiram_get_size());
- Serial.print("PSRAM INIT : ");
- Serial.println(psramInit());
- Serial.print("PSRAM Found : ");
- Serial.println(psramFound());
- if(psramFound()){
- // Serial.print("Total PSRAM using caps:");
- // Serial.println(heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
- Serial.print("Total PSRAM:");
- Serial.println(ESP.getPsramSize());
- Serial.print("Free PSRAM: ");
- Serial.println(ESP.getFreePsram());
- // Serial.setDebugOutput(true);
- }
- }
- void loop() {
- delay(2000);
- }
Problems:
This is the log that I get when I put the core debug level to "Verbose".
...............................................................................
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13516
load:0x40080400,len:3604
entry 0x400805f0
[ 2][W][esp32-hal-psram.c:61] psramInit(): PSRAM not supported!
Total heap:365028
Free heap: 340280
PSRAM INIT : 0
PSRAM Found : 0
.....................................................................................
Other codes, which probably don't use PSRAM, work perfectly fine.
Things I have tried so far:
I have used the same code in EPS32-D0WD and ESP32-PICOD4, they show the PSRAM with size of it.
I have externally pull-ed up the chip select pin, but I don't get 3.3V at chip select.
Connected GPIO 4 to the chip select pin and In the code, I did digitalWrite HIGH.