Suddenly PSRAM ID read errors… did a configuration file get corrupted?

PeteDD
Posts: 45
Joined: Sat Sep 24, 2022 5:22 pm

Suddenly PSRAM ID read errors… did a configuration file get corrupted?

Postby PeteDD » Wed Nov 02, 2022 10:15 pm

I have been working with an ESP32-S3-DEVKITC-U1-N8R8 very successfully, using PSRAM for large arrays then all of a sudden when I upload new (or old, known working) code I get the following errors and the PSRAM of course will not init. I am using Visual Code Studio with Platformio as my IDE.

Code: Select all

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x39c
load:0x403b6000,len:0x9a4
load:0x403ba000,len:0x2868
SHA-256 comparison failed:
Calculated: 9127e332554622857d5c753c9ffbb9862bfb72e81ded80db80617d5974000cec
Expected: 867c0d6cb8d08f5a22bebcb1e4a5d457c2700a1c6b76abeb4d778eadcc3446e2
Attempting to boot anyway...
entry 0x403b61c0
E (172) psram: PSRAM ID read error: 0x00ffffff
[   172][W][esp32-hal-psram.c:71] psramInit(): PSRAM init failed!
After it happened on one DEVKIT, I got out another brand new one and got the same error messages.

Is it possible that my IDE somehow corrupted a file that is being loaded? This would be some sort of configuration file since this error is happening for all my previously working projects that use this board. And if so, how do I restore the necessary files?

What has changed, I ask myself… well I was alternatively using a FeatherS3 and the DevKit boards, changing the platformio.ini config when I changed boards. In any case, everything was fine and then all of a sudden all DEVKIT boards throw this PSRAM ID read error message.

Just for good measure, here is my platformio.ini file which has worked just fine all along.

Code: Select all

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
;upload_port = COM9
monitor_speed = 115200
monitor_port = COM13

framework = arduino

lib_ldf_mode = deep
lib_extra_dirs = ~/Documents/Arduino/libraries
board_build.partitions = default_partitions.csv
build_flags =
    -I./src/
	  -DCORE_DEBUG_LEVEL=5
	  -DBOARD_HAS_PSRAM
	  -mfix-esp32-psram-cache-issue
      -fmax-errors=5
     
Thank you for any help.

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: Suddenly PSRAM ID read errors… did a configuration file get corrupted?

Postby ESP_Sprite » Thu Nov 03, 2022 12:24 am

The N8R8 has octal SPI... I can't see if that matches your config (don't have any experience with platformio) but that may be a thing to look at; perhaps it needs some special flag for that.

PeteDD
Posts: 45
Joined: Sat Sep 24, 2022 5:22 pm

Re: Suddenly PSRAM ID read errors… did a configuration file get corrupted?

Postby PeteDD » Fri Nov 04, 2022 1:29 pm

Yes indeed. It turns out one line was missing from my platformio.ini (the loss was caused by google drive overwriting... I have since removed Google drive from my system)

Code: Select all

board_build.arduino.memory_type = dio_opi ; THIS LINE IS VERY IMPORTANT FOR BUILTIN PSRAM
In addition, the following must be in the platformio.ini file:

Code: Select all

build_flags =
	  -DCORE_DEBUG_LEVEL=5
	  -DBOARD_HAS_PSRAM
	  -mfix-esp32-psram-cache-issue
	 

Who is online

Users browsing this forum: Bing [Bot], Corand and 121 guests