Hi
is it true/possible that the sd card feature alone takes up about 70% of the 1284p memory (= about 11 KB)?
With the SD feature compiled it takes about 92% of dynamic memory and without it takes up about 20%.
Is that expected?
Thanks!
Yes.
More info on how to attack this problem here: https://github.com/MarlinFirmware/Marlin/issues/7190
-=dave
I was thinking a person could run the avr-objdump program and see how big the SD memory card object files are.
Indeed! Due to the huge amount of memory in the 1284p the CR-10 config has SDCARD_ALPHA_SORT set to maximum caching. Feel free to tweak this feature's sub-options for less memory usage.
ook, cause I was wondering how THAT would fit into a ATmega2560, everyone is "upgrading" to.
Yes, it has more IOs and more flash but dynamic memory is the half...
Thanks, I'll look into that, was just wondering if that is expected or if there is some unsupported combination of settings in the my configuration file which leads to that huge amount of used dynamic memory.
indeed, when I disabled the SDCARD_ALPHA_SORT feature, memory usage dropped to about 25%. unbelievable what a memory hog that feature is. maybe that fact could be mentioned somewhere in the comments really prominently?
if I'd have more time I'd look into the code if there is any chance of optimizing, however I guess that has been written by geniuses and that I won't have any chance of getting that thing optimized in any way...
indeed, when I disabled the SDCARD_ALPHA_SORT feature, memory usage dropped to about 25%. unbelievable what a memory hog that feature is. maybe that fact could be mentioned somewhere in the comments really prominently?
It uses very little memory if configured differently. Play with the sub-options, which are described reasonably well in the configuration.
Its designed to eat memory apparently with some of the rest of the features.
Yes, it is! The allocation it uses in the CR-10 configuration is an extreme, but the 1284p has all that extra SRAM which otherwise Marlin would just leave sitting unused. Marlin allocates all the SRAM it needs at compile time, so the only thing that it uses the unallocated SRAM for at runtime is the stack, and for that 1K-2K free SRAM should be more than enough.
At the moment the SCROLL_LONG_FILENAMES feature causes the cached alpha sort to balloon in size, but I hope to fix that in the near future so it uses only the minimum SRAM for caching and only pulls a complete long filename from the SD card when needed.
i like that software ;-) great piece of work!