-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Too little DMA memory (or free memory block) is available for the eps32s3 (or other esp32s) #12075
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
Comments
Related to #11853? (That issue is high on the priority list and is a consequence of the recent move to IDF v5.0.2) |
I highly doubt that would be the case. I also tried to modify the Further I tracked down the change log of the main.c file (I searched for main.c on that site to locate the file) and it seems like the micropython heap is allocated the same way. In the older version, line 140, 146 and 147 are effectively excuted for the esp32s3 and in the newer version, these are the same 3 lines. The main difference between newer and older version is, that the newer Version uses So I took my next approach. First of all, I changed the
It built and booted, but the same problem is still present. So I assume that this problem is not the new idf version related... But there is a fairly chance that I am wrong since I am a beginner and know very little about this whole project. EDIT: of cause I assumed that there are no significant changes to the |
set the MP heap hardcoded to 2000*1024=2048000. We should get about 2000KB MP heap.
Still gc.mem_free() shows about half of the 8MB PSRAM free.
But esp32.idf_heap_info() reports 'correctly' - (8388608, 6338304, 6291456, 6338304) the 6338304 is about 6MB since MP was set to 2000KB. gc.mem_free() uses py/gc.c gc_info(), maybe gc.c is broken?
mem_info() also reports a total of 4274752, but it should be 2048000. |
@shariltumin you need to change the |
@dpgeorge Thanks! My mistake. With 8MB PSRAM I managed to build two firmwares v1.20.0-283-g7d66ae603 esp-idf 5.0.2 on ESP32S3-N16R8 board: 1) 2/6 MP/IDF and 2) 6/2 MP/IDF Below is a somewhat lengthy report of the results of my tests. The msgpipe is a C module that allocates/deallocates memory to/from a ring buffer structure using malloc()/free(). #Firmware 2/6 test. Source modification:
REPL run:
The idf heap is not deallocated during a soft reboot. #Firmware 6/2 test. Source modification:
REPL run:
ESP-WARNING "ESP32 has a few hundred kilobytes of internal RAM, residing on the same die as the rest of the chip components. It can be insufficient for some purposes, so ESP32 has the ability to use up to 4 MB of virtual addresses for external PSRAM (Psuedostatic RAM) memory. The external memory is incorporated in the memory map and, with certain restrictions, is usable in the same way as internal data RAM." Despite the above warning, I manage to allocate more than 4MB of memory block. I do not know the impact on system stability, perhaps more knowledgeable can explain. This is my SPIRAM configuration file in the sdkconfig.board file.
Sorry for taking up so much space, but I hope it is useful. |
Hi, I am having trouble to get the maximum 256KB DMA block using the latest release. After some hardcoded debug print in a C-Module, I found out that the maximum allocatable memory block is roughly at 247KB. This is the code I've used:
Now I don't know if this is a bug... But, if uPy is using roughly 16KB of RAM as it advertised (which I highly doubt on the esp32 port, because of wifi and stuff), and freeRTOS taking at most 10KB according to this (that being all the ROM has been loaded into the RAM), why isn't it possible to allocate 256KB of continous block? Is this caused by some bug or have I underestimate the memory usage of uPy by a huge margine?
The text was updated successfully, but these errors were encountered: