This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Stack always 0x1500?

Other Parts Discussed in Thread: HALCOGEN

Hello,

In my project (Code Composer Studio Version: 6.1.3.00033) and TMS570 target I don't seem to be able to change the stack and heap size.

No matter what I put in the stack and heap boxes in CCS Build->ARM Linker->Basic Options, I always get the same size in the MAP-file.

STACKS 08000000 00001500 00000000 00001500 RW

RAM 08001500

I have tried one byte of stack, and a very big stack. No difference in map file.

How to solve this?

  • Hi,

      You can change the stack size as shown below in HalCoGen. In the screenshot I change the user stack length to 0x00002000 instead of 0x00001000 which is the default. Once you generate the code you will see the updated stack pointers configuration and the linker command file. Also see below.

    ;-------------------------------------------------------------------------------
    ; Initialize Stack Pointers
    ; SourceId : CORE_SourceId_002
    ; DesignId : CORE_DesignId_002
    ; Requirements: HL_SR478
    
        .def     _coreInitStackPointer_
        .asmfunc
    
    _coreInitStackPointer_
    
            cps   #17
            ldr   sp,       fiqSp
            cps   #18
            ldr   sp,       irqSp
            cps   #19
            ldr   sp,       svcSp
            cps   #23
            ldr   sp,       abortSp
            cps   #27
            ldr   sp,       undefSp
            cps   #31
            ldr   sp,       userSp
            bx    lr
    
    userSp  .word 0x08000000+0x00002000
    svcSp   .word 0x08000000+0x00002000+0x00000100
    fiqSp   .word 0x08000000+0x00002000+0x00000100+0x00000100
    irqSp   .word 0x08000000+0x00002000+0x00000100+0x00000100+0x00000100
    abortSp .word 0x08000000+0x00002000+0x00000100+0x00000100+0x00000100+0x00000100
    undefSp .word 0x08000000+0x00002000+0x00000100+0x00000100+0x00000100+0x00000100+0x00000100
    
        .endasmfunc

    MEMORY
    {
    VECTORS (X) : origin=0x00000000 length=0x00000020
    FLASH0 (RX) : origin=0x00000020 length=0x0013FFE0
    STACKS (RW) : origin=0x08000000 length=0x00002500
    RAM (RW) : origin=0x08002500 length=0x0002db00

    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    }