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.
Tool/software: Code Composer Studio
We're trying to figure out how to control the size of our stack.
We are using CCSv7 version 7.1.0.00016 and building our project with two different compiler toolchains: ti-cgt-arm_16.9.3.LTS and gcc-arm-none-eabi-4_9-2015q3.
Evidently our project was created with a default stack size of 512 bytes. Suppose we wish to increase that to 4096.
For the TI linker, we changed the setting "Set C system stack size (--stack_size, -stack)" as shown in the screenshot to 4096. However, that doesn't appear to be the end of the story. Our project contains the linker command file tm4c129encpdt.cmd, and it contains the line "__STACK_TOP = __stack + 512;" It appears CCS copied this file into our project from C:\ti\ccsv7\ccs_base\arm\include\tm4c129encpdt.cmd, because the two files are identical, and both contain this line. It appears that changing the project's linker setting from 512 to 4096 does not automatically update this file. __STACK_TOP is used in the 0th entry of the vector table in the startup c file.
For the GCC linker, there doesn't appear to be any project setting for stack size. In this case, we have a linker command file tm4c129encpdt.lds and our startup file tm4c129encpdt_startup_gcc.c. The linker command file doesn't appear to deal with the stack size at all, whereas the startup c file contains the line "static uint32_t pui32Stack[128];" and, for the vector table, calculates the initial stack pointer using sizeof().
So our questions are:
(1) For the TI linker, are we required to update the stack size in two places: the project settings and the __STACK_TOP line in the linker command file? Are there additional places to update?
(2) For the GCC compiler/linker, is it enough to update the "static uint32_t pui32Stack[128];" line? Are there additional places to update?
(3) With either option, how can we verify definitively that the stack size is, indeed, set correctly?
Sorry, I neglected to address the questions regarding the TI compiler:
twelve12pm said:(1) For the TI linker, are we required to update the stack size in two places: the project settings and the __STACK_TOP line in the linker command file? Are there additional places to update?
Yes, I believe you are right. It is also mentioned in the below thread:
https://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/413930/1476356#1476356
ki