Xinyuan-LilyGO / LilyGo-T5-Epaper-Series

173 stars 57 forks source link

[DEPG0266BN] spiram: SPI RAM not initialized #48

Open iw0der opened 6 months ago

iw0der commented 6 months ago

Hi, I'm experiencing some errors on the hardware module LILYGO® TTGO T5 2.66-Inch E-Paper. Now I want to report here the first problem encountered!

I try to use/enable the external RAM via Arduino IDE but I only get crashes, at most I get to this:

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (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 (298) spiram: SPI RAM not initialized

abort() was called at PC 0x401027b7 on core 0

Backtrace: 0x400838cd:0x3ffe3af0 0x4008d1cd:0x3ffe3b10 0x400926cd:0x3ffe3b30 0x401027b7:0x3ffe3bb0 0x401027f7:0x3ffe3bd0 0x401026cb:0x3ffe3bf0 0x400e5623:0x3ffe3c20 0x40082fe1:0x3ffe3c50 0x40079316:0x3ffe3c90 |<-CORRUPTED

ELF file SHA256: ee06d735f4dcf31a

I chose the ESP32 Wrover Kit as the compilation template but I also tried other combinations... I chose psram enable but when I run the code it gives an error like the one reported.

Am I forgetting some steps or do I have a problem with recognizing the external RAM?

At boot it seems that it is not detected and the crash reports library functions even before my setup:

0x400838cd: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c line 408
0x4008d1cd: esp_system_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/esp_system.c line 137
0x400926cd: abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/abort.c line 46
0x401027b7: esp_spiram_get_chip_size at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/port/esp32/spiram.c line 145
0x401027f7: esp_spiram_get_size at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/port/esp32/spiram.c line 241
0x401026cb: esp_himem_init at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/port/esp32/esp_himem.c line 134
0x400e5623: start_cpu0_default at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/startup.c line 201
0x40082fe1: call_start_cpu0 at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/hal/esp32/include/hal/cpu_ll.h line 39

only if I remove the define _HAS_PSRAM it doesn't crash but it tells me, according to code, that there is no RAM present. This is the function that triggers the crash:

static uint32_t psRAM(void)
{
  uint32_t psRAMsize = -1;
  bool psr = testSPIRAM();

  log_i("========================================");  
  log_i("Test SPI RAM         : %s", (psr ? "OK" : "Error" ));
#ifdef _HAS_PSRAM
  if (psramInit()) {
    log_i("PSRAM total size     : %u", esp_spiram_get_size());
    log_i("----------------------------------------");
    log_i("PSRAM first 4MB size : %u", ESP.getPsramSize());
    log_i("PSRAM first 4MB free : %u", ESP.getMaxAllocPsram());
    log_i("PSRAM HI-MEM    size : %u", esp_himem_get_phys_size());
    log_i("PSRAM HI-MEM    free : %u", esp_himem_get_free_size());
    psRAMsize = esp_spiram_get_size() / 1024;
  }
  else {
    log_w("PSRAM not found");
  }
#else
  log_w("PSRAM is not enabled on this board");
#endif
  log_i("========================================");
  log_i("Internal RAM  size   : %u", ESP.getHeapSize()); 
  log_i("Internal RAM  free   : %u", ESP.getFreeHeap()); 
  log_i("========================================");

  return(psRAMsize);
}

When I comment the the define:

// #define _HAD_PSRAM

The code does not abort at the start and the notable lines on the console are:

[   462][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
E (2688) spiram: SPI SRAM memory test fail. 131072/131072 writes failed, first @ 3F800000

Thanks

73, Arturo.

lewisxhe commented 6 months ago

It seems that the PSRAM has failed. Contact the seller to replace it.