Embedded firmware has limited RAM, and stack overflow can silently corrupt data. cargo-call-stack estimates whole-program stack usage so you can compare it with the stack region configured in memory.x. section 7.0 section 7.4.2
The analysis uses per-function stack-size metadata emitted by a nightly Rust compiler. Install cargo-call-stack with stable Cargo, add nightly rust-src, and enable fat LTO for the release profile. section 7.4.2
cargo +nightly call-stack --target thumbv7em-none-eabihf --bin myapp > cg.dot dot -Tsvg cg.dot > cg.svg
Run the analysis on the nightly-built target binary, then render its call-graph output as SVG with Graphviz. section 7.4.2
The report gives per-function maxima and the deepest call path. Treat its estimate as a lower bound: indirect calls may be unknown, and interrupt depths are reported separately. Allow a 25–50% safety margin; flip-link and runtime checks provide additional defenses. section 7.4.2 section 7.5
