Calculation of stack sizes...

Hallo

I wonder if there are any good methodes of calculating the stack size for ex user or IRQ stack size? Is there any "best practice"?

Or is it just add up the size of data structures and/ot ISR's??

/Thomas

Parents
  • some libraries require a minimum (RL-ARM, for example).
    generally, the best you can do is:
    * calculate exactly what the stack usage of every function is and all possible paths to it. better automate this, and you can make us of the statistics generated by the tool-chain.
    * use pre-inserted markers in the stacks themselves to follow stack usage overtime.
    * catch stack overflows by monitoring.
    * more...?

Reply
  • some libraries require a minimum (RL-ARM, for example).
    generally, the best you can do is:
    * calculate exactly what the stack usage of every function is and all possible paths to it. better automate this, and you can make us of the statistics generated by the tool-chain.
    * use pre-inserted markers in the stacks themselves to follow stack usage overtime.
    * catch stack overflows by monitoring.
    * more...?

Children
More questions in this forum