All tools
TOOL IDB-SWE-009
Stack size estimator

Desktop only

Engineering tools are available only on desktop screens.

Stack size estimator

Recommended task / ISR stack size from worst-case call depth, average frame size, ISR nesting, and OS overhead. Always validate against a stack-overflow guard.

Stack growth recommended — B
SP top ↓ grows down PUSH SP bottom ↑ (overflow guard) OS overhead 0 B ISR frames 0 B Call frames 0 B Margin 0 B Recommended 0 B In words (32-bit) 0 Call depth 8 × 48 B ISR depth 2 × 96 B
Engineering notes

Math

  • core = depth × frame + locals
  • isr_total = isr_depth × isr_frame
  • stack = (core + isr_total + os_overhead) × (1 + margin)

Reality check

  • Enable -fstack-usage and the linker .su files to get per-function real numbers.
  • FreeRTOS task stack is in WORDS (4 B). Convert before passing.
  • FPU enabled → +132 B per task that uses floats.

Result

Live