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

Stack and Heap in Scatter loading file

Dear all,

I use the new AT91Lib 1.5 that includes some Keil samples. These samples use a scatter loading file with the foloowing memory definitions:

Load_region 0x100000 0x80000 {

    Fixed_region 0x100000 0x80000 {
        *(cstartup +First)
       .ANY (+RO)
    }

    Relocate_region 0x200000 {
        *.o (VECTOR, +First)
       .ANY (+RW +ZI)
    }

    ScatterAssert(ImageLength(Relocate_region) <  0x6000)

    ARM_LIB_HEAP 0x206000 EMPTY 0x1000 {
    }

    ARM_LIB_STACK 0x208000 EMPTY -0x1000 {
    }
}

Now I need some more stack and heap. But everything I tried did not succeed. In an older project I defined stack and heap in the startup code as followed:

;// <h> Stack Configuration (Stack Sizes in Bytes)
;//   <o0> Undefined Mode      <0x0-0xFFFFFFFF:8>
;//   <o1> Supervisor Mode     <0x0-0xFFFFFFFF:8>
;//   <o2> Abort Mode          <0x0-0xFFFFFFFF:8>
;//   <o3> Fast Interrupt Mode <0x0-0xFFFFFFFF:8>
;//   <o4> Interrupt Mode      <0x0-0xFFFFFFFF:8>
;//   <o5> User/System Mode    <0x0-0xFFFFFFFF:8>
;// </h>

UND_Stack_Size  EQU     0x00000000
SVC_Stack_Size  EQU     0x00000008
ABT_Stack_Size  EQU     0x00000000
FIQ_Stack_Size  EQU     0x00000000
IRQ_Stack_Size  EQU     0x00000080
USR_Stack_Size  EQU     0x00002000

ISR_Stack_Size  EQU     (UND_Stack_Size + SVC_Stack_Size + ABT_Stack_Size + \ 
                         FIQ_Stack_Size + IRQ_Stack_Size)

                AREA    STACK, NOINIT, READWRITE, ALIGN=3

Stack_Mem       SPACE   USR_Stack_Size
__initial_sp    SPACE   ISR_Stack_Size
Stack_Top


;// <h> Heap Configuration
;//   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF>
;// </h>

Heap_Size       EQU     0x00002800

                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem        SPACE   Heap_Size
__heap_limit

I use the Atmel SAM7SE512 Processor that has 32kbytes of RAM.

Does anybody knows how to change ARM_LIB_HEAP and ARM_LIB_STACK?

Big thanks,

Christian

0