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.

MSP432E401Y: TI-RTOS-MCU: How to read stack size

Part Number: MSP432E401Y

Tool/software:

Hi all, 

I'm working with MSP432E401Y micro controller but the question is more related to TI-RTOS.

i'm using Code Composer Studio version 12, i have multiple tasks running in my project and wants to know stack size to make it more efficient.

i'm trying to figure out how to read the stack size of a task.

can anyone please help me to get this ?

Thank you very much

  • Hi,

      You can open the ROV view to figure out the stack usage. See below example. As you can see there are two tasks in this example. One is an Idle task and the other is a user task. On the Idle task the stack used is 376bytes while 2048bytes is reserved. 

  • hi ,

    thankyou for the quick response..

    i want to know whether we have any api to read the stack size ? if yes what is that api ?

  • Hi,

      No, there is no API as such as far as I'm aware of. I think you will need to create your own with a scheme that first loads the stack with a known pattern like DEADBEEF. After your run your program, the stack area that still remains with DEADBEEF is the number of bytes that are not used. You should know how much total stack you reserve for each task stack.