TC4xx promo banner Banner_Aurix_Competition Banner_AURIX_Security-Solution Banner_AURIX_Safety_Products ShieldBuddy TC275 Banner_AURIX_DevelopmentStudio


+ Reply to Thread
Results 1 to 3 of 3

Thread: Stack depth and Stack usage calculation - TC Boards

  1. #1
    Beginner Beginner SRS_Sabat is on a distinguished road
    Join Date
    Apr 2021
    Location
    India
    Posts
    16
    Points
    120

    Stack depth and Stack usage calculation - TC Boards

    Hi !!

    The scenario is as such, I am using Tasking compiler 6.2r2 and TC375TP and have access to both on-chip debugger and trace32 debugger.

    I want to calculate 2 things -
    1. Worst case stack depth i.e I have an API that I know has a max number of calls and functionality. For this particular API, I need to calculate the stack depth (worst-case stack depth). How to do it?

    2. I had got this link for IFX - SDA,
    but there isn't any link/source to download. Can anybody please help with the setup? And will this help me fulfill my requirement mentioned in #1?

    3. [A general query] Is stack depth a number i.e the number of function calls, and stack usage is the consumed byte on the stack? or both are the same terminologies used synonymously?

    Please don't suggest THIS.
    This isn't what I am looking for.

    Thanks !!!

  2. #2
    Advanced Advanced UC_wrangler will become famous soon enough
    Join Date
    Jun 2019
    Posts
    507
    Points
    10540
    I equate "stack depth" and "stack usage". The number of function calls isn't nearly as important as the local variables allocated by each function. So, it's entirely possible that the deepest level of your application's call tree might not be the worst case stack depth.

    I don't know of any better method than the old school standby of:
    - Fill the stack with a known pattern like 0x55555555, 0xC0CAC07A, 0xDEADBEEF, etc.
    - Let your application run for a few seconds and do what you can do ensure every code path is executed
    - Look at the stack in a debugger and see how much of the known pattern remains

    Your SDA link is to an ancient Tasking tool that was developed for the ancient TC17xx.

  3. #3
    Beginner Beginner SRS_Sabat is on a distinguished road
    Join Date
    Apr 2021
    Location
    India
    Posts
    16
    Points
    120
    Quote Originally Posted by UC_wrangler View Post

    Your SDA link is to an ancient Tasking tool that was developed for the ancient TC17xx.
    Hi Wrangler,

    1. Is there any other tool that can help me with this requirement ?
    2. And when you say to check in the debugger, are you mentioning looking at the A10 register or something else other than that? Because if in case of context switching, the A10 register value will reset once context switch happens. So what is
    the plan in that scenario then?

    Thanks !

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.