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.

RTOS/MSP430F5659: Clarification required stack peak usage - Task

Part Number: MSP430F5659

Tool/software: TI-RTOS

Hi support team,

Thanks for valuble support

In our firmware design, we have 4 task for communication, Data Handling , Diagnostic ,Watchdog.

 

Scheduling:                             Priority based pre-emptive scheduling

Inter task communication:    Mailbox is used

Mailbox size:                           90 character max

Stack size:                               512 bytes

Firmware Design Analysis:

We checked the stack usage of all task which is in running state (at different stages ) and blocked state in debug mode.

 1.  So at first  we run the device in debug mode and kept breakpoint in 4 places of the Communication task and observe stack peak of all task.

                                            Stack Peak: Communication task - 370 , Data Manager -240 , Diagnostic -380 , Watchdog -122,

 2.  Then  we run the device in debug mode and kept breakpoint in 2 places of the Data Manager and observe stack peak of all task.

Stack Peak: Communication task - 370/470 , Data Manager -240 , Diagnostic - 380, Watchdog -122,

Clarification Point:

1.If we kept breakpoint in Data Manager and run communication task in free running mode. Why communication task ,stack peak reaches 470 bytes?

2. Mailbox also uses stack allocated for the task ?

It is 90% of the stack maximum size allocated. We would like to understand the cause of this behavior.

Kindly provide valuable inputs on the behavior to improvise this condition to prevent unexpected behavior of firmware.

Thanks

Manoj

  • Hi Manoj,

    How are you measuring the stack usage? I don't think that setting breakpoints and manually viewing your stack use is a good representation of the maximum stack usage.

    There is a simple way to do this in CCS without using breakpoints. Section 7.5.3 of the TI RTOS Kernal User's Guide shows how this can be accomplished. Can you use this approach to measure you're max stack usage and let me know if you have any questions?

    Best regards, 
    Caleb Overbay

  • Hi Manoj,

    Have you been able to solve this issue? If so could you post your solution to the forum to help others who may experience the same issue?

    Best regards,
    Caleb Overbay

**Attention** This is a public forum