SPI PSRAM in WROOM module issue

tsctrl
Posts: 30
Joined: Tue Dec 08, 2020 1:37 pm

SPI PSRAM in WROOM module issue

Postby tsctrl » Tue Jun 22, 2021 3:19 pm

Hi All,

i have added psram to my esp32 board with piggyback approach.
i successfully enable the psram support in the menuconfig but i not able to enable:
[ ] Initialize SPI RAM during startup. in menuconfig.
230206.jpg
230206.jpg (135.23 KiB) Viewed 2481 times
Below are the boot result when the option was disabled:

Code: Select all

I (30) boot: ESP-IDF v4.3-dev-2940-g6e776946d-dirty 2nd stage bootloader
I (31) boot: compile time 22:56:54
I (32) boot: chip revision: 1
I (35) boot.esp32: SPI Speed      : 40MHz
I (40) boot.esp32: SPI Mode       : DIO
I (45) boot.esp32: SPI Flash Size : 2MB
I (49) boot: Enabling RNG early entropy source...
I (55) boot: Partition Table:
I (58) boot: ## Label            Usage          Type ST Offset   Length
I (65) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (73) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (80) boot:  2 factory          factory app      00 00 00010000 00100000
I (88) boot: End of partition table
I (92) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=07598h ( 30104) map
I (112) esp_image: segment 1: paddr=000175c0 vaddr=3ffb0000 size=029d0h ( 10704) load
I (116) esp_image: segment 2: paddr=00019f98 vaddr=40080000 size=00404h (  1028) load
I (120) esp_image: segment 3: paddr=0001a3a4 vaddr=40080404 size=05c74h ( 23668) load
I (138) esp_image: segment 4: paddr=00020020 vaddr=400d0020 size=165d0h ( 91600) map
I (173) esp_image: segment 5: paddr=000365f8 vaddr=40086078 size=06c6ch ( 27756) load
I (192) boot: Loaded app from partition at offset 0x10000
I (192) boot: Disabling RNG early entropy source...
I (204) cpu_start: Pro cpu up.
I (204) cpu_start: Starting app cpu, entry point is 0x40080fe4
I (0) cpu_start: App cpu up.
D (212) clk: RTC_SLOW_CLK calibration value: 3097178
I (223) cpu_start: Pro cpu start user code
I (223) cpu_start: cpu freq: 240000000
I (223) cpu_start: Application information:
I (228) cpu_start: Project name:     blink
I (232) cpu_start: App version:      1
I (237) cpu_start: Compile time:     Jun 22 2021 22:56:26
I (243) cpu_start: ELF file SHA256:  0c9d2034c94b8d4a...
I (249) cpu_start: ESP-IDF:          v4.3-dev-2940-g6e776946d-dirty
V (256) memory_layout: reserved range is 0x3f407578 - 0x3f4075b8
D (262) memory_layout: Checking 8 reserved memory ranges:
D (267) memory_layout: Reserved memory range 0x3f800000 - 0x3fc00000
D (274) memory_layout: Reserved memory range 0x3ffae000 - 0x3ffae6e0
D (280) memory_layout: Reserved memory range 0x3ffb0000 - 0x3ffb31f8
D (287) memory_layout: Reserved memory range 0x3ffe0000 - 0x3ffe0440
D (293) memory_layout: Reserved memory range 0x3ffe3f20 - 0x3ffe4350
D (300) memory_layout: Reserved memory range 0x40070000 - 0x40078000
D (306) memory_layout: Reserved memory range 0x40078000 - 0x40080000
D (312) memory_layout: Reserved memory range 0x40080000 - 0x4008cce4
D (319) memory_layout: Building list of available memory regions:
V (325) memory_layout: Examining memory region 0x3f800000 - 0x3fc00000
V (332) memory_layout: Region 0x3f800000 - 0x3fc00000 inside of reserved 0x3f800000 - 0x3fc00000
V (340) memory_layout: Examining memory region 0x3ffae000 - 0x3ffb0000
V (347) memory_layout: Start of region 0x3ffae000 - 0x3ffb0000 overlaps reserved 0x3ffae000 - 0x3ffae6e0
D (357) memory_layout: Available memory region 0x3ffae6e0 - 0x3ffb0000
V (363) memory_layout: Examining memory region 0x3ffb0000 - 0x3ffb8000
V (370) memory_layout: Start of region 0x3ffb0000 - 0x3ffb8000 overlaps reserved 0x3ffb0000 - 0x3ffb31f8
D (379) memory_layout: Available memory region 0x3ffb31f8 - 0x3ffb8000
V (386) memory_layout: Examining memory region 0x3ffb8000 - 0x3ffc0000
D (393) memory_layout: Available memory region 0x3ffb8000 - 0x3ffc0000
V (399) memory_layout: Examining memory region 0x3ffc0000 - 0x3ffc2000
D (406) memory_layout: Available memory region 0x3ffc0000 - 0x3ffc2000
V (412) memory_layout: Examining memory region 0x3ffc2000 - 0x3ffc4000
D (419) memory_layout: Available memory region 0x3ffc2000 - 0x3ffc4000
V (426) memory_layout: Examining memory region 0x3ffc4000 - 0x3ffc6000
D (432) memory_layout: Available memory region 0x3ffc4000 - 0x3ffc6000
V (439) memory_layout: Examining memory region 0x3ffc6000 - 0x3ffc8000
D (445) memory_layout: Available memory region 0x3ffc6000 - 0x3ffc8000
V (452) memory_layout: Examining memory region 0x3ffc8000 - 0x3ffca000
D (459) memory_layout: Available memory region 0x3ffc8000 - 0x3ffca000
V (465) memory_layout: Examining memory region 0x3ffca000 - 0x3ffcc000
D (472) memory_layout: Available memory region 0x3ffca000 - 0x3ffcc000
V (478) memory_layout: Examining memory region 0x3ffcc000 - 0x3ffce000
D (485) memory_layout: Available memory region 0x3ffcc000 - 0x3ffce000
V (491) memory_layout: Examining memory region 0x3ffce000 - 0x3ffd0000
D (498) memory_layout: Available memory region 0x3ffce000 - 0x3ffd0000
V (505) memory_layout: Examining memory region 0x3ffd0000 - 0x3ffd2000
D (511) memory_layout: Available memory region 0x3ffd0000 - 0x3ffd2000
V (518) memory_layout: Examining memory region 0x3ffd2000 - 0x3ffd4000
D (524) memory_layout: Available memory region 0x3ffd2000 - 0x3ffd4000
V (531) memory_layout: Examining memory region 0x3ffd4000 - 0x3ffd6000
D (538) memory_layout: Available memory region 0x3ffd4000 - 0x3ffd6000
V (544) memory_layout: Examining memory region 0x3ffd6000 - 0x3ffd8000
D (551) memory_layout: Available memory region 0x3ffd6000 - 0x3ffd8000
V (557) memory_layout: Examining memory region 0x3ffd8000 - 0x3ffda000
D (564) memory_layout: Available memory region 0x3ffd8000 - 0x3ffda000
V (571) memory_layout: Examining memory region 0x3ffda000 - 0x3ffdc000
D (577) memory_layout: Available memory region 0x3ffda000 - 0x3ffdc000
V (584) memory_layout: Examining memory region 0x3ffdc000 - 0x3ffde000
D (590) memory_layout: Available memory region 0x3ffdc000 - 0x3ffde000
V (597) memory_layout: Examining memory region 0x3ffde000 - 0x3ffe0000
D (604) memory_layout: Available memory region 0x3ffde000 - 0x3ffe0000
V (610) memory_layout: Examining memory region 0x3ffe0000 - 0x3ffe4000
V (617) memory_layout: Start of region 0x3ffe0000 - 0x3ffe4000 overlaps reserved 0x3ffe0000 - 0x3ffe0440
V (626) memory_layout: End of region 0x3ffe0440 - 0x3ffe4000 overlaps reserved 0x3ffe3f20 - 0x3ffe4350
D (636) memory_layout: Available memory region 0x3ffe0440 - 0x3ffe3f20
V (642) memory_layout: Examining memory region 0x3ffe4000 - 0x3ffe8000
V (649) memory_layout: Start of region 0x3ffe4000 - 0x3ffe8000 overlaps reserved 0x3ffe3f20 - 0x3ffe4350
D (659) memory_layout: Available memory region 0x3ffe4350 - 0x3ffe8000
V (665) memory_layout: Examining memory region 0x3ffe8000 - 0x3fff0000
D (672) memory_layout: Available memory region 0x3ffe8000 - 0x3fff0000
V (678) memory_layout: Examining memory region 0x3fff0000 - 0x3fff8000
D (685) memory_layout: Available memory region 0x3fff0000 - 0x3fff8000
V (691) memory_layout: Examining memory region 0x3fff8000 - 0x3fffc000
D (698) memory_layout: Available memory region 0x3fff8000 - 0x3fffc000
V (705) memory_layout: Examining memory region 0x3fffc000 - 0x40000000
D (711) memory_layout: Available memory region 0x3fffc000 - 0x40000000
V (718) memory_layout: Examining memory region 0x40070000 - 0x40078000
V (724) memory_layout: Region 0x40070000 - 0x40078000 inside of reserved 0x40070000 - 0x40078000
V (733) memory_layout: Examining memory region 0x40078000 - 0x40080000
V (740) memory_layout: Region 0x40078000 - 0x40080000 inside of reserved 0x40078000 - 0x40080000
V (749) memory_layout: Examining memory region 0x40080000 - 0x40082000
V (755) memory_layout: Region 0x40080000 - 0x40082000 inside of reserved 0x40080000 - 0x4008cce4
V (764) memory_layout: Examining memory region 0x40082000 - 0x40084000
V (771) memory_layout: Region 0x40082000 - 0x40084000 inside of reserved 0x40080000 - 0x4008cce4
V (780) memory_layout: Examining memory region 0x40084000 - 0x40086000
V (786) memory_layout: Region 0x40084000 - 0x40086000 inside of reserved 0x40080000 - 0x4008cce4
V (795) memory_layout: Examining memory region 0x40086000 - 0x40088000
V (802) memory_layout: Region 0x40086000 - 0x40088000 inside of reserved 0x40080000 - 0x4008cce4
V (811) memory_layout: Examining memory region 0x40088000 - 0x4008a000
V (817) memory_layout: Region 0x40088000 - 0x4008a000 inside of reserved 0x40080000 - 0x4008cce4
V (826) memory_layout: Examining memory region 0x4008a000 - 0x4008c000
V (833) memory_layout: Region 0x4008a000 - 0x4008c000 inside of reserved 0x40080000 - 0x4008cce4
V (841) memory_layout: Examining memory region 0x4008c000 - 0x4008e000
V (848) memory_layout: Start of region 0x4008c000 - 0x4008e000 overlaps reserved 0x40080000 - 0x4008cce4
D (858) memory_layout: Available memory region 0x4008cce4 - 0x4008e000
V (864) memory_layout: Examining memory region 0x4008e000 - 0x40090000
D (871) memory_layout: Available memory region 0x4008e000 - 0x40090000
V (877) memory_layout: Examining memory region 0x40090000 - 0x40092000
D (884) memory_layout: Available memory region 0x40090000 - 0x40092000
V (891) memory_layout: Examining memory region 0x40092000 - 0x40094000
D (897) memory_layout: Available memory region 0x40092000 - 0x40094000
V (904) memory_layout: Examining memory region 0x40094000 - 0x40096000
D (910) memory_layout: Available memory region 0x40094000 - 0x40096000
V (917) memory_layout: Examining memory region 0x40096000 - 0x40098000
D (924) memory_layout: Available memory region 0x40096000 - 0x40098000
V (930) memory_layout: Examining memory region 0x40098000 - 0x4009a000
D (937) memory_layout: Available memory region 0x40098000 - 0x4009a000
V (943) memory_layout: Examining memory region 0x4009a000 - 0x4009c000
D (950) memory_layout: Available memory region 0x4009a000 - 0x4009c000
V (957) memory_layout: Examining memory region 0x4009c000 - 0x4009e000
D (963) memory_layout: Available memory region 0x4009c000 - 0x4009e000
V (970) memory_layout: Examining memory region 0x4009e000 - 0x400a0000
D (976) memory_layout: Available memory region 0x4009e000 - 0x400a0000
I (983) heap_init: Initializing. RAM available for dynamic allocation:
D (990) heap_init: New heap initialised at 0x3ffae6e0
I (995) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
D (1001) heap_init: New heap initialised at 0x3ffb31f8
I (1007) heap_init: At 3FFB31F8 len 0002CE08 (179 KiB): DRAM
I (1013) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1019) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (1026) heap_init: New heap initialised at 0x4008cce4
I (1031) heap_init: At 4008CCE4 len 0001331C (76 KiB): IRAM
D (1038) FLASH_HAL: extra_dummy: 1
V (1041) memspi: raw_chip_id: 164020

V (1045) memspi: chip_id: 204016

V (1048) memspi: raw_chip_id: 164020

V (1052) memspi: chip_id: 204016

D (1055) spi_flash: trying chip: issi
D (1059) spi_flash: trying chip: gd
D (1063) spi_flash: trying chip: mxic
D (1067) spi_flash: trying chip: winbond
D (1070) spi_flash: trying chip: generic
I (1074) spi_flash: detected chip: generic
I (1079) spi_flash: flash io: dio
W (1083) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
D (1096) cpu_start: calling init function: 0x400d5e54
D (1102) cpu_start: calling init function: 0x400d0be0
V (1107) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1113) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xC0E
D (1122) intr_alloc: Connected src 17 to int 2 (cpu 0)
D (1127) efuse: coding scheme 0
D (1130) efuse: In EFUSE_BLK0__DATA3_REG is used 1 bits starting with 15 bit
D (1137) efuse: coding scheme 0
D (1140) efuse: In EFUSE_BLK0__DATA5_REG is used 1 bits starting with 20 bit
V (1147) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1154) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (1162) intr_alloc: Connected src 24 to int 3 (cpu 0)
I (1167) cpu_start: Starting scheduler on PRO CPU.
D (0) efuse: coding scheme 0
D (0) efuse: In EFUSE_BLK0__DATA3_REG is used 1 bits starting with 15 bit
D (0) efuse: coding scheme 0
D (10) efuse: In EFUSE_BLK0__DATA5_REG is used 1 bits starting with 20 bit
V (10) intr_alloc: esp_intr_alloc_intrstatus (cpu 1): checking args
V (20) intr_alloc: esp_intr_alloc_intrstatus (cpu 1): Args okay. Resulting flags 0x40E
D (30) intr_alloc: Connected src 25 to int 2 (cpu 1)
I (30) cpu_start: Starting scheduler on APP CPU.
D (1257) heap_init: New heap initialised at 0x3ffe0440
D (1257) heap_init: New heap initialised at 0x3ffe4350
I (1267) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
D (1277) spiram: Allocating block of size 32768 bytes
V (1277) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1277) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1277) intr_alloc: Connected src 16 to int 9 (cpu 0)
I (1297) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
heap size: 417635
free heap: 257480
malloc cap 8bit: 288095
malloc free psram: 0
psram size: 0
Test code to check the RAM size:

Code: Select all

printf("heap size: %d\n", info.total_free_bytes + info.total_allocated_bytes);
printf("free heap: %d\n", esp_get_free_heap_size());
printf("malloc cap 8bit: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT));
printf("malloc free psram: %d\n", heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
multi_heap_info_t info1;
heap_caps_get_info(&info1, MALLOC_CAP_SPIRAM);
printf("psram size: %d\n", info1.total_free_bytes + info1.total_allocated_bytes);
however when calling heap_caps_get_free_size(MALLOC_CAP_SPIRAM) the value are 0;

When enabled the Initialize SPI RAM during startup :

Code: Select all


D (223) efuse: coding scheme 0
esp-idf/components/freertos/queue.c:1441 (xQueueSemaphoreTake)- assert failed!
Re-enable cpu cache.

abort() was called at PC 0x40089490 on core 0
Backtrace:0x4008827e:0x3ffe39c0 0x400889fd:0x3ffe39e0 0x4008d6c2:0x3ffe3a00 0x40089490:0x3ffe3a70 0x4008d5c5:0x3ffe3ab0 0x400e8e1f:0x3ffe3ad0 0x4008d57f:0x3ffe3b00 0x400d8117:0x3ffe3b50 0x400d8005:0x3ffe3bb0 0x400d7fc1:0x3ffe3bd0 0x4008367c:0x3ffe3c00 0x400d5369:0x3ffe3c30 0x4008124c:0x3ffe3c50 0x40079231:0x3ffe3c80 |<-CORRUPTED

ELF file SHA256: b0658467dc0a9b5f
Rebooting...
1. i not sure if the psram are correctly detected, am i on the correct path? what is missing? how do i get the psram to work?
2. currently on GPIO 16 and 17, can i use gpio 6 and gpio11 instead of gpio 16 and 17?
3. can i use vspi port instead of the piggyback port? i have vspi port unused. need change custom port in menuconfig?

edit:

update: i have try to use wrover devkit modules with the same result.

stack result:
Decoding stack results
0x400881d6: panic_abort at /esp-idf/components/esp_system/panic.c line 356
0x4008892d: esp_system_abort at /esp-idf/components/esp_system/system_api.c line 112
0x4008d5f2: abort at /esp-idf/components/newlib/abort.c line 46
0x400893c0: xQueueSemaphoreTake at /esp-idf/components/freertos/queue.c line 1441
0x4008d4f5: esp_log_impl_lock_timeout at /esp-idf/components/log/log_freertos.c line 45
0x400e7d4f: esp_log_writev at /esp-idf/components/log/log.c line 170
0x4008d4af: esp_log_write at /esp-idf/components/log/log.c line 199
0x400d704f: esp_efuse_utility_process at /esp-idf/components/efuse/src/esp_efuse_utility.c line 71
0x400d6f3d: esp_efuse_read_field_blob at /esp-idf/components/efuse/src/esp_efuse_api.c line 47
0x400d6ef9: esp_efuse_get_pkg_ver at /esp-idf/components/efuse/src/esp32/esp_efuse_fields.c line 65
0x40083618: psram_enable at /esp-idf/components/esp32/spiram_psram.c line 808
0x400d42b5: esp_spiram_init at /esp-idf/components/esp32/spiram.c line 150
0x40081240: call_start_cpu0 at /esp-idf/components/esp_system/port/cpu_start.c line 347

Thank you in advanced

tsctrl
Posts: 30
Joined: Tue Dec 08, 2020 1:37 pm

Re: SPI PSRAM in WROOM module issue

Postby tsctrl » Tue Jun 22, 2021 8:02 pm

based on this issue library update are required.
https://github.com/espressif/esp-idf/issues/5343

how ever i still getting psram size 0

Who is online

Users browsing this forum: Google [Bot] and 57 guests