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.

F28x End of Task Stack

The F28x is different from all of our other cores in that the stack grows from low addresses to high addresses.  My question/issue is how to determine the end (highest address) of a task stack?  I envisioned that I could so something like set a watchpoint at "TSK0$stack+TSK0$stacksize".  The big problem is that we don't define anything equivalent to TSK0$stacksize!

Is there any other solution you can think of?  If not, can you please file an enhancement request?

  • Hi Brad --

    What you are asking for would only work for static tasks (created via configuration tool).

    We define 2 fields in the TSK_Obj structure that might work for you.   TSK_Obj.stack is address of stack base (low address).   TSK_Obj.stacksize is the size of the stack.

    So, if you have the task handle, you should be able to get these 2 fields.

    BTW, David Alter wrote an app note on 28x stack checking several years (7!) back that might be of interest: http://focus.ti.com/lit/an/spra820/spra820.pdf

    -Karl-

  • Karl,

    Great info.  Thanks for the answer.  I think we're covered from the BIOS perspective, i.e. your method is more flexible since it covers dynamically created tasks too.

    I'm not quite in the clear since I'm having trouble viewing these fields in CCS.  I started a thread in the CCS forum for that issue though:

     Watch Window having trouble understanding structure

    Thanks a lot for pointing me to David Alter's app note.  It's quite excellent -- a bit of a shame it's not a little more well known!  In any case I have added a link to the app note in the wiki page that I was working on.  In case you're interested all these questions originated from the "simple" task of adding F28x to this wiki page:

    http://processors.wiki.ti.com/index.php?title=Checking_for_Stack_Overflow_using_Unified_Breakpoint_Manager

    Best regards,
    Brad