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.

API for estimating System stack [== ISR stack] usage?

Other Parts Discussed in Thread: SYSBIOS

Hi All,

         I understand System Stack is used by HWi's and Swi's and is given the exact number in .cfg file. I went through various [memory related] docs in keystone series [including sys-bios]. I understand ROV and its working. what i wanted is "getting snapshot/statistics of the system stack usage in run time" [plz note that this dsp does not have any access to JTAG, its built in release mode and run on .eth image....ROV is ruled out..mm.also let me know if there is a possibility under such situations].

the way memory snapshot/statistics are available for heap usage and task stack, is there any API where i can get the following information.

current usage, max usage, total size...etc 

also i understand that this system stack is to be roughly pre-calculated [based on possible number of Hwi's and Swi's used in system] and given the correct number. but, still i wanted a wayto estimate the stats of it [dynamically].

My questions are

1. is there any API readily available as part of Ti sysbios or Ti packges [MCSDK installation].

2. or do I need to write my own API. If so how to get memory start address of the system stack to poll for a known pattern [like 0xDEADBEEF or 0xBEBEBEBE] and calculate/compute. please let me know more on this.

Thanks

RC Reddy

  • Hi RC Reddy,

    You can use the Hwi_getStackInfo() API from the Hwi module to determine the size, base address and stack depth for the system stack at runtime.

    Here's a link to the API documentation:

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/sysbios/6_34_04_22/exports/bios_6_34_04_22/docs/cdoc/index.html#ti/sysbios/hal/Hwi.html#get.Stack.Info

    Best,

    Ashish

  • Hi Ashish,

                    Appreciate your quick reply. Is there any swi stack usage API similar to Hwi stack usage.

    I checked at this link [for Swi stack usage], could not find any.

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/sysbios/6_34_04_22/exports/bios_6_34_04_22/docs/cdoc/ti/sysbios/knl/Swi.html#xdocElems

    let me know is there swi stack usage API.

    Thanks

    RC Reddy

  • The Hwi and Swi use the same ISR (or System) stack and hence the Hwi_getStackInfo() API would apply to both.

    Best,

    Ashish

  • Hi Ashish,

                    Just wanted to double confirm your statement [""Hwi_getStackInfo() API would apply to both""]. but the statement [in the weblink (which you provided)] is in different meaning "getStackInfo returns the Hwi stack usage info to its calling function". Can i have it confirmed one more time on this.

    Thanks

    RC Reddy

  • Hi RC Reddy,

    What I was trying to say was that we do not have a separate getStackInfo() API for Swi since both Hwi and Swi run on the same stack. So, whether you want to determine stack stats for the Hwi or Swi, you would always use Hwi_getStackInfo(). 

    Best,

    Ashish

  • Hi,

       Thanks. I understand/got it now.

    Thanks

    RC Reddy