Closed mohamed-elsabagh closed 4 years ago
Which idf version(commit id) are you using ? Have you defined any functions with IRAM_ATTR attribute ?
I am using the latest version on master branch, and I didn't define any function using IRAM_ATTR attribute
Maybe try with SPIRAM type set to auto.
the SPIRAM is already set to auto detect here is the configuration file for this part
#
# SPI RAM config
#
CONFIG_SPIRAM_TYPE_AUTO=y
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
CONFIG_SPIRAM_SIZE=-1
CONFIG_SPIRAM_SPEED_40M=y
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set
# CONFIG_SPIRAM_USE_MEMMAP is not set
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
CONFIG_SPIRAM_CACHE_WORKAROUND=y
CONFIG_SPIRAM_BANKSWITCH_ENABLE=y
CONFIG_SPIRAM_BANKSWITCH_RESERVE=4
# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set
Ok, I saw this:
#
# SPI RAM config
#
# CONFIG_SPIRAM_TYPE_AUTO is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
CONFIG_SPIRAM_TYPE_ESPPSRAM64=y
sorry, I updated while testing but still didn't work same error
I disabled bluetooth driver, and compiled to get size
Total sizes:
DRAM .data size: 15580 bytes
DRAM .bss size: 20336 bytes
Used static DRAM: 35916 bytes ( 88664 available, 28.8% used)
Used static IRAM: 114952 bytes ( 16120 available, 87.7% used)
Flash code: 717471 bytes
Flash rodata: 161816 bytes
Total image size:~1030155 bytes (.bin may be padded larger)
I am not sure why IRAM is 87.7% used while only DRAM is 28.8%, also where can I see the external ram size here?
Actually I understand the problem now, it is from IRAM static memory overflow, that was because the libraries I was using from esp-idf was optimized to use IRAM, once I disabled optimization on WiFi and LWIP it released enough memory to compile the project
On latest master we've added a kconfig option for using parts of SRAM1 as IRAM in https://github.com/espressif/esp-idf/commit/5cbd311ecf0b381a0711ef8a96980a67b30a135f which will help with this issue.
We've also focused on reducing IRAM usage/making placement optional for several components. For an full overview of all such option see Optimizing-iram-usage. All new options for saving IRAM we add will be listed in this chapter.
Hello, I am building a complex application on esp32, I need more ram so I am using the ESP32-WROVER-B module. I am trying to activate the external ram, so I changed configuration,
Component Config ---> ESP32-specific ---> Support for external, SPI-connected RAM
and changed this to true. Assuming that all I need to tell esp32 to start using external ram in memory allocation I tried to build project next and I get linker errorWhen I deactivate the external RAM, the code compiles with no problem, am I missing any step?
Here is my sdk.config