This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using External Memory for Heap

How do I configure the HEAP to be placed within the external memory?

I'm using an LPC1778 with 2MB external memory. I want the controller to calculate an a*-algorithm on a bitmap (loaded from sd-card). Thus, i need lots of dynamically allocated memory (by malloc/realloc).

While searching the forum i only found this: http://www.keil.com/support/man/docs/armlib/armlib_CHDJHFGB.htm .

Can anybody tell me how and where to set the __heap_base to 0x80000000 and the __heap_size to 0x100000?

Parents
  • This is how my scatter file looks out now:

    LR_IROM1 0x00000000 0x00080000  {    ; load region size_region
      ER_IROM1 0x00000000 0x00080000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_RAM1 0x80000000 0x00200000  {  ; RW data
       sram.o (+ZI +RW)
       .ANY (+RW +ZI)
      }
      RW_IRAM1 0x10000000 0x00010000  {
       .ANY (+RW +ZI)
      }
    }
    

    Unfortunately, if i try to Debug my program, i run into the HardFaultHandler even before main() is called. Within the linker options inside uVision4 i have deselected "Use Memory Layout from Target Dialog" and set the R/W Base to 0x80000000. Has anyone an idea?

Reply
  • This is how my scatter file looks out now:

    LR_IROM1 0x00000000 0x00080000  {    ; load region size_region
      ER_IROM1 0x00000000 0x00080000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_RAM1 0x80000000 0x00200000  {  ; RW data
       sram.o (+ZI +RW)
       .ANY (+RW +ZI)
      }
      RW_IRAM1 0x10000000 0x00010000  {
       .ANY (+RW +ZI)
      }
    }
    

    Unfortunately, if i try to Debug my program, i run into the HardFaultHandler even before main() is called. Within the linker options inside uVision4 i have deselected "Use Memory Layout from Target Dialog" and set the R/W Base to 0x80000000. Has anyone an idea?

Children