Reply To: ESP32 WROVER PSRAM

Sysprogs forums Forums VisualGDB ESP32 WROVER PSRAM Reply To: ESP32 WROVER PSRAM

#27622
yuriar
Participant

Hello,

I’m having a similar problem. I am using the latest toolchain and I’m trying to use the external SPI ram memory but something isn’t working quite right.

I have done all possible combinations of PSram in the visualGDB settings but I can’t get the external memory working properly.

When I run the application I can see the external memory is tested and recognized by the system, however, it always returns a null pointer when I try to use the external memory.

 

For example, using this configuration bellow I can check that the heap increased and I have extra memory. But when I try to do a simple test like allocating 15KB, the ESP32 return null.

#
# ESP32-specific
#
CONFIG_ESP32_DEFAULT_CPU_FREQ_80=
CONFIG_ESP32_DEFAULT_CPU_FREQ_160=
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
CONFIG_SPIRAM_SUPPORT=y

#
# SPI RAM config
#

CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=
CONFIG_SPIRAM_USE_MEMMAP=
CONFIG_SPIRAM_USE_CAPS_ALLOC=
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_TYPE_AUTO=y
CONFIG_SPIRAM_TYPE_ESPPSRAM32=
CONFIG_SPIRAM_TYPE_ESPPSRAM64=
CONFIG_SPIRAM_SIZE=-1
CONFIG_SPIRAM_SPEED_40M=
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_SPIRAM_CACHE_WORKAROUND=y
CONFIG_SPIRAM_BANKSWITCH_ENABLE=y
CONFIG_SPIRAM_BANKSWITCH_RESERVE=8
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=

 

I’m using esp32-cam which has 4MB PSRAM, I just can’t use it.

When I use make menuconfig, the external memory works and I can allocate anything without any problem.

I can’t just easily import my sdkconfig from my make menuconfig. Is there a way that I can use a pre-defined sdkconfig instead of the graphical one? I have the right configuration but I can’t get the same thing from the visualGDB interface. Also, every time when I compile it, my configuration file gets overwritten.

Attachments:
You must be logged in to view attached files.