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.

CCS/MSP-TS430PN80USB: Stack size not changing in "Stack Usage" view after updating value in project properties

Part Number: MSP-TS430PN80USB

Tool/software: Code Composer Studio

Hello,

I am trying to test computationally intensive code my MSP430 platform that requires me to increase the size of the stack from the default value. However, when I change this value it does not seem to effect the maximum stack size displayed when I look at the "Stack Usage" tool within View->Stack Usage (screen shot attached with stack size changed to 4800.) The max stack size value seems to be pegged at 660 no matter what I set the maximum value to be in the settings. Interestingly, the "Memory Allocation" does seem to change as a function of the max stack size value I set (screen shot also attached.)

I am changing the stack size by editing the "Set C system stack size" field within Project->Properties.->CCS Build->MSP430 Linker->Basic options to 4800. Also, when I check my "..._linkInfo.xml" file the "__STACK_SIZE" field is updating to the value I set.

Compiler version: TI v18.1.5.LTS

Please let me know if any additional information would be helpful here.

Thanks!

  • Hello,

    Zander Nevitt said:
    Compiler version: TI v18.1.5.LTS

    thanks. What exact CCS version are you using?

    Thanks

    ki

  • Hello!

    My CCS version is:

    Version: 8.3.0.201810301800
    Build id: N201810301800

    Thank you.

  • Zander Nevitt said:
    However, when I change this value it does not seem to effect the maximum stack size displayed when I look at the "Stack Usage" tool within View->Stack Usage (screen shot attached with stack size changed to 4800.)

    The "Stack Usage" tool shows the maximum stack which will be used by a program based upon a static analysis of the call tree and stack usage of each function.

    Whereas the "Memory Allocation" view shows how much memory has been allocated for the stack by the linker.

    I.e. the two views are displaying different information.

  • Thank you, Chester. This makes sense. 

    Is it possible to change the max stack usage that any function is allotted?

  • Zander Nevitt said:
    Is it possible to change the max stack usage that any function is allotted?

    I checked with my colleague and his answer: 

    "Not directly.  The amount of stack used by a function is determined by the combined size of the local variables defined in that function."

  • Thank you for your reply.

    I understand that the amount of memory a function requires is determined by the amount/size of the local variables within that function. I am wondering if it is possible to increase the maximum amount of memory allocated to a function beyond the "660 bytes" shown in my screen shot. For my application I require functions that create a large amount of local variables.

    Thank you.

  • Zander Nevitt said:
    I am wondering if it is possible to increase the maximum amount of memory allocated to a function beyond the "660 bytes" shown in my screen shot.

    Not directly.  You can change it indirectly.  As an experiment, add a large array within the function main.  That will cause this number to increase.

    Zander Nevitt said:
    For my application I require functions that create a large amount of local variables.

    I don't understand this concern.  The compiler automatically allocates sufficient memory for local variables.  So as long you don't overflow the stack, this detail requires no further work.

    Thanks and regards,

    -George