Has anyone been successful in setting up the Keil tools and changing the Startup.s file to place the heap in external location (on SD/MMC Card or off-chip memory)?
The only reason that I want to use external memory is because I am using a library for the file system that needs to dynamically allocate space. The amount of space it needs to allocate is more than I have in internal memory.
Iam working on LPC2378 with keil uvision4.
Any help will be appreciated. Thanks in advance
How would you be able to have your heap in serially accessed memory? Does your processor support virtual memory management, making it able to automagically swap data in or out of the SD memory?
Note that heap objects are accessed using standard pointers, so the processor expects a heap object to be possible to make operations on as if stored in normal RAM.
The file system (most probably working with your SD memory) needs RAM buffers. But these RAM buffers can't be in same technology as the SD memory, or the file system code wouldn't have needed them in the first place.
Why does your file system library need so much RAM? For large file systems, a fs driver can't expect to at the same time be able to store the full allocation data (FAT tables or whatever the specific file system uses) and a significant number of directories and a significant amount of file data in RAM at the same time. Even a full PC normally needs to move meta data in/out from the file system since huge file systems can have a gigabyte or more of allocation tables and directory entry information. It's a constant trade off between performance and resources and a reason why there are so many different file systems and file system implementations in existence.
Thanks very much for your reply. What could be the other options available? Because my RAM is only 32KB. To my knowledge (RW Data + ZI Data) will make use of RAM and in my code it completely uses the RAM. But still I could n't allote the required memory. Normally what could be the options available if application needs more memory (dynamic memory)
The only real option is to fit more physical memory - either by using a microcontroller with more internal memory, or by adding suitable external memory.
Note that many microcontrollers do not have any facility to add external memory.
View all questions in Keil forum