place heap in external location

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

Parents
  • 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.

Reply
  • 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.

Children
More questions in this forum