I've never tested psRAM operation on ESP32-PICO-D4 board (I don't have any at the moment). I'll probably get one next month, then I'll try to attach psRAM chip and test it.
With MicroPython, if psRAM is enabled, "Initialise SPI RAM when booting the ESP"
must be enabled. The initialization code sets the variable which is used by MicroPython code to decide if the heap can be placed in psRAM. If the initialization code is not run, this variable is just set to "success" state and allocating the MicroPython heap in psRAM will be attempted.
The first log message related to MicroPython is "
D (ttt) MicroPython: Entry" (
app_main() entry).
Any crash before it is not in any way related to MicroPython.
I have tested running with psRAM on WROVER modules and on
WROOM modules with externally added 3.3V psRAM and never had any issue.
I have no idea why you have an issue with ESP32-WROOM with psRAM.
I've tested with psRAM attached as described
here. ESP-WROOM-32 module must be with
rev1 ESP32
Here is the log when running on WROOM module with added psRAM:
rst:0x1 (POWERON_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:0x3fff0018,len:4
load:0x3fff001c,len:4996
load:0x40078000,len:8112
load:0x40080000,len:6488
0x40080000: _WindowOverflow4 at /home/LoBo2_Razno/ESP32/MicroPython/MicroPython_ESP32_psRAM_LoBo/Tools/esp-idf/components/freertos/xtensa_vectors.S:1685
entry 0x40080300
0x40080300: _KernelExceptionVector at /home/LoBo2_Razno/ESP32/MicroPython/MicroPython_ESP32_psRAM_LoBo/Tools/esp-idf/components/freertos/xtensa_vectors.S:536
I (695) spiram: SPI RAM mode: flash 80m sram 40m
I (695) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (696) cpu_start: Pro cpu up.
I (699) cpu_start: Starting app cpu, entry point is 0x40081674
0x40081674: call_start_cpu1 at /home/LoBo2_Razno/ESP32/MicroPython/MicroPython_ESP32_psRAM_LoBo/Tools/esp-idf/components/esp32/cpu_start.c:225
I (0) cpu_start: App cpu up.
I (1560) spiram: SPI SRAM memory test OK
I (1561) heap_init: Initializing. RAM available for dynamic allocation:
D (1561) heap_init: New heap initialised at 0x3ffaff10
I (1566) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
D (1572) heap_init: New heap initialised at 0x3ffce8e0
I (1577) heap_init: At 3FFCE8E0 len 00011720 (69 KiB): DRAM
I (1584) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1590) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (1597) heap_init: New heap initialised at 0x4009a7fc
I (1602) heap_init: At 4009A7FC len 00005804 (22 KiB): IRAM
I (1608) cpu_start: Pro cpu start user code
I (1613) spiram: Adding pool of 4096K of external SPI memory to heap allocator
D (1621) clk: waiting for 32k oscillator to start up
E (1706) clk: RTC: Not found External 32 kHz XTAL. Switching to Internal 150 kHz RC chain
D (1714) clk: RTC_SLOW_CLK calibration value: 2973786
I (155) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
D (156) heap_init: New heap initialised at 0x3ffe0440
D (161) heap_init: New heap initialised at 0x3ffe4350
D (166) MicroPython: Entry
D (1169) MicroPython: SPIRAM: Enabled
D (1178) nvs: nvs_flash_init_custom partition=nvs start=9 count=6
D (1206) MicroPython: Configure stack
D (1206) nvs: nvs_open_from_partition MPY_NVM 1
D (1206) nvs: nvs_get MPY_StackSize 4
D (1206) nvs: nvs_get_str_or_blob MpyTimeZone
D (1211) nvs: nvs_get MPY_do_scripts 4
D (1214) MicroPython: MPy stack: 0x3ffd3e40 - 0x3ffd7e48 (16392)
D (1220) MicroPython: Configure heap
D (1224) nvs: nvs_get MPY_HeapSize 4
D (1227) MicroPython: MPy heap: 0x3f80001c - 0x3fb0005c (3145728)
D (1234) MicroPython: Main task exit, stack used: 1428
I (1242) MicroPython: [=== MicroPython FreeRTOS task started (sp=3ffd7d70) ===]
The log when running the same firmware on WROOM without psRAM:
rst:0x1 (POWERON_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:0x3fff0018,len:4
load:0x3fff001c,len:4996
load:0x40078000,len:8112
load:0x40080000,len:6488
0x40080000: _WindowOverflow4 at /home/LoBo2_Razno/ESP32/MicroPython/MicroPython_ESP32_psRAM_LoBo/Tools/esp-idf/components/freertos/xtensa_vectors.S:1685
entry 0x40080300
0x40080300: _KernelExceptionVector at /home/LoBo2_Razno/ESP32/MicroPython/MicroPython_ESP32_psRAM_LoBo/Tools/esp-idf/components/freertos/xtensa_vectors.S:536
E (684) spiram: SPI RAM enabled but initialization failed. Bailing out.
I (684) cpu_start: Failed to init external RAM; continuing without it.
I (687) cpu_start: Pro cpu up.
I (691) cpu_start: Starting app cpu, entry point is 0x40081674
0x40081674: call_start_cpu1 at /home/LoBo2_Razno/ESP32/MicroPython/MicroPython_ESP32_psRAM_LoBo/Tools/esp-idf/components/esp32/cpu_start.c:225
I (0) cpu_start: App cpu up.
I (702) heap_init: Initializing. RAM available for dynamic allocation:
D (708) heap_init: New heap initialised at 0x3ffaff10
I (714) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
D (720) heap_init: New heap initialised at 0x3ffce8e0
I (725) heap_init: At 3FFCE8E0 len 00011720 (69 KiB): DRAM
I (731) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (737) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (744) heap_init: New heap initialised at 0x4009a7fc
I (749) heap_init: At 4009A7FC len 00005804 (22 KiB): IRAM
I (755) cpu_start: Pro cpu start user code
D (760) clk: waiting for 32k oscillator to start up
E (845) clk: RTC: Not found External 32 kHz XTAL. Switching to Internal 150 kHz RC chain
D (852) clk: RTC_SLOW_CLK calibration value: 2996966
I (189) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
D (189) heap_init: New heap initialised at 0x3ffe0440
D (194) heap_init: New heap initialised at 0x3ffe4350
D (199) MicroPython: Entry
W (1202) MicroPython: SPIRAM support enabled but SPIRAM not detected
D (1202) MicroPython: SPIRAM: Disabled
D (1202) nvs: nvs_flash_init_custom partition=nvs start=9 count=6
D (1244) MicroPython: Configure stack
D (1244) nvs: nvs_open_from_partition MPY_NVM 1
D (1244) nvs: nvs_get MPY_StackSize 4
D (1245) nvs: nvs_get_str_or_blob MpyTimeZone
D (1249) nvs: nvs_get MPY_do_scripts 4
D (1253) MicroPython: MPy stack: 0x3ffd3c2c - 0x3ffd7c34 (16392)
D (1259) MicroPython: Configure heap
D (1262) nvs: nvs_get MPY_HeapSize 4
D (1266) MicroPython: MPy heap: 0x3ffe436c - 0x3fff63ac (73728)
D (1272) MicroPython: Main task exit, stack used: 1436
I (1273) MicroPython: [=== MicroPython FreeRTOS task started (sp=3ffd7b60) ===]