Crash after enable PSRAM

brainbugfix
Posts: 2
Joined: Tue May 07, 2024 7:09 pm

Crash after enable PSRAM

Postby brainbugfix » Tue May 07, 2024 7:42 pm

Hi,

I have an application which worked on a CYD. Now I added a PSRAM which also works if I just read out information. I can allocate and free memory there, so everything fine.
If I now compile the same application which worked before, ESP32 crashes at different points. When wifi is connecting, it crashes with a watchdog. The same if I use the touch of the display at VSPI (HSPI is apparently used for PSRAM).

Here is one example of a crash when connecting to wifi.

Code: Select all

Hello Arduino! V9.1.0
Heap: 245320
Free Heap: 217288
PSRAM: 4192107
Free PSRAM: 4191863
[  2506][E][webradio.ino:30] setup(): [DEBUG] FLASH mode:dio
[  2519][E][webradio.ino:34] setup(): [DEBUG] FLASH freq:80m
[  2525][E][webradio.ino:40] setup(): [DEBUG] SPIRAM freq:80MHz
[  2531][E][webradio.ino:48] setup(): [DEBUG] CONFIG_SPIRAM_OCCUPY_HSPI_HOST enabled
[  2538][E][webradio.ino:53] setup(): [DEBUG] esp_spiram_get_size : 8388608
[  2545][E][webradio.ino:54] setup(): [DEBUG] esp_spiram_get_cs_io : 16
[  2551][E][webradio.ino:55] setup(): [DEBUG] esp_spiram_get_chip_size : 2
217288
lvgl setup done
Connecting to WiFi
[  2963][D][WiFiGeneric.cpp:1040] _eventCallback(): Arduino Event: 0 - WIFI_READY
[  3045][D][WiFiGeneric.cpp:1040] _eventCallback(): Arduino Event: 2 - STA_START
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x4008fcfc  PS      : 0x00060d30  A0      : 0x801070e0  A1      : 0x3ffd4940  
A2      : 0xffffff9f  A3      : 0xffffffff  A4      : 0xffffff9f  A5      : 0x00060d23  
A6      : 0x00060d23  A7      : 0x00000001  A8      : 0x00000001  A9      : 0x00000004  
A10     : 0x00060d23  A11     : 0x3ffdfef0  A12     : 0x00060720  A13     : 0x00060323  
A14     : 0x007bf5f8  A15     : 0x003fffff  SAR     : 0x00000017  EXCCAUSE: 0x0000001c  
EXCVADDR: 0xffffffdf  LBEG    : 0x4008c3fd  LEND    : 0x4008c40d  LCOUNT  : 0xfffffffe  


Backtrace: 0x4008fcf9:0x3ffd4940 0x401070dd:0x3ffd4980 0x401079d9:0x3ffd49d0 0x401037ad:0x3ffd4a00 0x40100709:0x3ffd4a20 0x40100fc7:0x3ffd4a40 0x400d2a72:0x3ffd4a60 0x40104917:0x3ffd4ad0


ELF file SHA256: c7baa6f0aefcff22

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
[    25][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[   481][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
Hello Arduino! V9.1.0
Heap: 245320
Free Heap: 217288
PSRAM: 4192107
Free PSRAM: 4191863
[  2506][E][webradio.ino:30] setup(): [DEBUG] FLASH mode:dio
[  2519][E][webradio.ino:34] setup(): [DEBUG] FLASH freq:80m
[  2525][E][webradio.ino:40] setup(): [DEBUG] SPIRAM freq:80MHz
[  2531][E][webradio.ino:48] setup(): [DEBUG] CONFIG_SPIRAM_OCCUPY_HSPI_HOST enabled
[  2538][E][webradio.ino:53] setup(): [DEBUG] esp_spiram_get_size : 8388608
[  2545][E][webradio.ino:54] setup(): [DEBUG] esp_spiram_get_cs_io : 16
.......
Apparently an address is not correct but why is it with PSRAM disabled?

At the moment I have no clue where the problem is exactly. Maybe someone can point me to the right track.

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

Re: Crash after enable PSRAM

Postby ESP_Sprite » Wed May 08, 2024 6:33 am

Suggest you decode that backtrace to figure out where the offending function is.

brainbugfix
Posts: 2
Joined: Tue May 07, 2024 7:09 pm

Re: Crash after enable PSRAM

Postby brainbugfix » Fri May 10, 2024 8:51 am

Apparently one of the displays SPI pins was wrongly configured. There is nothing which reads from the display that's why no problem before the PSRAM but when enabling it, this pin configuration messed up everything leading to that crash.

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

Re: Crash after enable PSRAM

Postby ESP_Sprite » Fri May 10, 2024 2:27 pm

Good to hear you found the culprit!

Who is online

Users browsing this forum: No registered users and 57 guests