-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Statically allocated DRAM is limited to 160KB (IDFGH-1187) #3497
Comments
Yes too much static ram usage. This is the wrong place to post Read this |
hmmm - that's weird: ESP32: 4 MByte flash, 520 KB SRAM M4: 512 KB flash, 192 KB RAM if ESP32 RAM is so restricted, then that is big drawback and that issue should be fixed ASAP! |
from https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/mem_alloc.html "Note: |
OMG, that should have been made absolutely clear BEFORE I had purchased that thing! Can that "technical limitation" be reworked and fixed? |
Hi @dsyleixa, The total SRAM is 520KB but this is DRAM+IRAM, and only DRAM (320KB) is normally used for data, IRAM is normally used for executable instructions. It is possible to store data in IRAM but there are restrictions. Regarding how Adafruit advertise the ESP32, you'll have to take this up with them. But they are technically correct. Working around the static memory limitation should be possible without too much work. If you have some larger buffer like this:
Then change it to a pointer, and allocate it during setup with malloc() or calloc(). This makes it dynamic memory not static memory:
Also, as @negativekelvin mentions, for Arduino issues please post on the Arduino issue tracker or the Arduino forum of esp32.com. |
sorry, but I can't handle pointer and allocates, that is far beyond my skills :( I don't post to Arduino.cc forum, because there are too many outrageous and insulting users. |
There is an Arduino subforum on esp32.com, that's the one I was referring to: |
ok, perhaps in future. |
There's no hardware issue. This is a software issue in ESP-IDF that the amount of statically assigned DRAM in an app is limited to 160KB. We don't have a GitHub issue tracking this, so we can start tracking it here. We don't have an ETA for fixing this issue as it's complex to fix (for architectural reasons) and it's generally easy to work around by assigning large buffers dynamically (see above post with suggestion). But we do plan to fix it at some point. (There is also the related but different issue #3211 ) |
I'm also looking for a solution for that, dynamic allocation makes my code much more error-prone. |
* WString explicit converters to reduce Flash size This is a port from the same patch for ESP8266: https://github.com/esp8266/Arduino/pull/6759/files
The DRAM limitations are now clearly stated in the documentation. |
closing the issue |
my point is to change 2x160kB to 1x320kB to be able to address it as a unit in its entirety. |
please reopen this issue because it is not fixed yet. |
Hi @dsyleixa, I am sorry we closed the issue after more than 2 years of inactivity without giving out more information about why we closed it. The reason why Fixing the problem would require moving said functions at the end of the DRAM memory but as @projectgus mentioned more than 2 years ago this is far from being a trivial fix and it would require a lot of architectural changes which explains why as of now it has not been addressed. As I can't guaranty that this issue will ever be fixed, I would encourage you to consider (or reconsider) the following workaround:
We have an internal ticket reporting this issue so it won't be forgotten and we don't want you to rely on this issue being fixed I am sorry again that this issue was left unaddressed for so long. |
code compiles and works for M4 plus TFT HX8357,
but fails for ESP32;
Arduino IDE 1.8.8
Board: Adafruit Feather ESP32
core: ESP32 espressive 1.0.2
compile errors (when linking) for my code
Perhaps too much code and too little RAM at ESP32?
complete error msg in attachement
compileError.txt
source code also attached
ConwayGoL_M4_Logic_NOR.zip
The text was updated successfully, but these errors were encountered: