All tools
TOOL IDB-SWE-009
Stack size estimator

僅限桌面

工程工具僅在桌面螢幕上提供。

堆疊大小估算器

依最壞情況下的呼叫深度、平均框架大小、ISR 巢狀與作業系統額外開銷,計算建議的任務/ISR 堆疊大小。請務必以堆疊溢位防護機制進行驗證。

堆疊成長 建議值 — 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
工程筆記

數學

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

實際檢核

  • 啟用 -fstack-usage 與連結器的 .su 檔案,以取得各函式的實際數值。
  • FreeRTOS 任務堆疊以字(4 B)為單位。傳入前請先換算。
  • 啟用 FPU → 每個使用浮點數的任務增加 +132 B。

結果

即時