Using external memory for the heap

I'm trying to configure a STR9 system to use an external memory device connected as Ext, MEM CS0 but I can't seam to get the malloc function to return a pointer to off chip memory. I have changed the standard STR91x.s to define Heap_Mem as 0x3C000000 and Heap_Size is set as normal. I have checked that the implementation of __user_initial_stackheap in the file is setting R0 and R2 to the correct values but when I look at a pointer returned by malloc it is at address 0x21770CB4. Does anyone know what I have missed?

Parents
  • A very simple solution is the following adaptation of the STR91x.s startup file:

    Replace

            AREA    HEAP, NOINIT, READWRITE, ALIGN=3
    


    with

            AREA    |.ARM.__AT_0x3C000000|, NOINIT, READWRITE, ALIGN=3
    

    Now Heap will be located at address 0x3C000000. No other changes are required except adjusting the Heap_Size.

Reply
  • A very simple solution is the following adaptation of the STR91x.s startup file:

    Replace

            AREA    HEAP, NOINIT, READWRITE, ALIGN=3
    


    with

            AREA    |.ARM.__AT_0x3C000000|, NOINIT, READWRITE, ALIGN=3
    

    Now Heap will be located at address 0x3C000000. No other changes are required except adjusting the Heap_Size.

Children
More questions in this forum