How to know that how many stack size is occupied by threads

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to know that how many stack size is occupied by threads

Jump to solution
649 Views
utsavikalpesh
Contributor V

Hi,

I am working on Code warrior v10.2 and of MQX v4.0. I am working on TWR-K60D100M.

I want to know that how much stack size occupied by my task.

In my TASK_TEMPLATE_STRUCT I am writing like this for example,

// Task Idx,Function,        Stack,   Priority,   Name,        Attributes,          Param, Time Slice
{ STARTUP_TASK_IDX,        Startup_TASK,      400, 12,"Startup_TASK",    MQX_AUTO_START_TASK,0,    0 },

There is 10 thread running in my code.

But I want to know actually how much stack size is occupied by the task.

How would I come to know that my task is occupying this much of memory??Is there any way to see that??

Please help.

0 Kudos
1 Solution
382 Views
soledad
NXP Employee
NXP Employee

Hi,

You can use the Task Aware Debugging tool.

The Task Aware Debugging (TAD) Tool is a useful and powerful instrument to debug the MQX application. CodeWarrior Special and Standard editions can create and run an MQX application, but cannot run TAD.

To use TAD:

1. Debug the application in CodeWarrior using the debug button. pastedImage_0.png

2. To stop the application, use a breakpoint or use the suspend button.

3. Once the application breaks, the menu enables two options: MQX RTOS and RTCS.

The MQX menu shows information about the core and tasks running at that moment in MQX RTOS, information such as memory usage, stack usage, semaphores, mutexes, events, kernel data, errors, and so on. The RTCS menu shows information about the TCPIP stack, configuration, sockets, TCP stats, UDP stats, IP stats, and so on. Figure 11 shows both MQX RTOS and RTCS.

pastedImage_1.png

4. Go to the MQX menu and click on „Task Summary‟ option. It shows the priority, state, and the task error if any.

pastedImage_2.png

5. Go to the MQX menu and click on „Stack Usage‟ option. It also shows if an overflow happens.

pastedImage_3.png


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
383 Views
soledad
NXP Employee
NXP Employee

Hi,

You can use the Task Aware Debugging tool.

The Task Aware Debugging (TAD) Tool is a useful and powerful instrument to debug the MQX application. CodeWarrior Special and Standard editions can create and run an MQX application, but cannot run TAD.

To use TAD:

1. Debug the application in CodeWarrior using the debug button. pastedImage_0.png

2. To stop the application, use a breakpoint or use the suspend button.

3. Once the application breaks, the menu enables two options: MQX RTOS and RTCS.

The MQX menu shows information about the core and tasks running at that moment in MQX RTOS, information such as memory usage, stack usage, semaphores, mutexes, events, kernel data, errors, and so on. The RTCS menu shows information about the TCPIP stack, configuration, sockets, TCP stats, UDP stats, IP stats, and so on. Figure 11 shows both MQX RTOS and RTCS.

pastedImage_1.png

4. Go to the MQX menu and click on „Task Summary‟ option. It shows the priority, state, and the task error if any.

pastedImage_2.png

5. Go to the MQX menu and click on „Stack Usage‟ option. It also shows if an overflow happens.

pastedImage_3.png


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos