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.

TMS570LS0714: TMS570 stack question.

Part Number: TMS570LS0714

Hi Champs,

the TMS570 has many type of stack  like following, may i know the detail means of each stack, and how to assign each stack size? which size should be large based on different application

  • Hi,

    Cortex-Rx architectures has a dedicated register called the stack pointer (SP, or R13) for each mode (R13_USER, R13_FIQ, R13_IRQ, etc). Its intended use is that when the program makes a function call, the function parameters and the return address are pushed to the stack, and they are popped when the function terminates and returns to its caller. Pushing onto the stack means writing at the address given by the stack pointer and decrementing the stack pointer accordingly. Popping means incrementing the stack pointer; the return address is read from the address given by the stack pointer.

    The stack length in the 2nd column is to defined the stack size for each mode. The stack is used to store the values of local variables inside of functions, the program address to return to when leaving those functions, and CPU general registers etc.

    An estimation method is to allocate larger stack space, fill the stack with a sentinel value, then monitor how much you actually use during execution.