Hi! I have been designing a custom board based on the ESP32 Wrover E and have successfully checked the modules I use (i2c, uart, spi, twai), showing that the hardware is OK.
The problem is when I want to enable the PSRAM memory of the esp32. As I have ESP32-WROVER-IE-N16R8, I have 8 MB of PSRAM memory, which should be able to occupy 4 MB as I understand. As it is a custom board, I decided to use the esp-wrover-kit board, my platform.ini looks like this:
[env:wrover-kit]
platform = espressif32
board = esp-wrover-kit
board_build.flash_mode = qio
board_build.f_flash = 80000000
framework = arduino
monitor_speed = 115200
build_flags =
-DCORE_DEBUG_LEVEL = 5
-DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
My main code is simple, to replicate the error I have the following:
#include <Arduino.h>
void setup() {
Serial.begin(115200);
if(psramInit()){
Serial.println("Se inicializo correctamente!");
}
else{
Serial.println("Error en inciar la PSRAM");
}
delay(1000);
Serial.printf("Total heap: %d \n", ESP.getHeapSize());
Serial.printf("Free heap: %d \n", ESP.getFreeHeap());
Serial.printf("Total PSRAM: %d \n", ESP.getPsramSize());
Serial.printf("Free PSRAM: %d \n", ESP.getFreePsram());
}
void loop() {
}
This gives me the error:
rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, 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:13964
load:0x40080400,len:3600
entry 0x400805f0
E (88) psram: PSRAM ID read error: 0xfffbff07
Error en inciar la PSRAM
Error en inciar la PSRAM
Total heap: 371772
Free heap: 346740
Total PSRAM: 0
Free PSRAM: 0
ets Jul 29 2019 12:21:46
To verify if the error is from the internal PSRAM of the module, I switched to the Arduino IDE occupying the following configuration:
In Arduino IDE for the same project I showed before, it gives me the following:
configsip: 0, 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:1240
load:0x40078000,len:13012
load:0x40080400,len:3648
entry 0x400805f8
Se inicializo correctamente!
Total heap: 399539
Free heap: 342519
Total PSRAM: 4192139
Free PSRAM: 4192139
In arduino ide recognizes the PSRAM! My suspicions have to do with the partitions, the board configurations or some problem in platform.ini. I also saw in some forums definitions for the memory type that when I define it with some value I get the following error:
fatal error: sdkconfig.h: No such file or directory
I have tried many things and I am running out of ideas. I will be very grateful if someone can help me
Best regards!