Work out firmware memory usage instantly with clear inputs, formula shown and shareable results.
Flash headroom matters for future features and for over-the-air updates, which typically need room for two images. RAM headroom is more critical still: what remains after static allocation must cover the deepest call stack plus any heap, and running out corrupts memory silently.
Memory budget
free = size - used; OTA-capable designs need code size below half the flash
Enough for worst-case stack depth including interrupt nesting, plus heap fragmentation margin. 25-30% free static RAM is a common rule.
A dual-bank scheme keeps the running image while writing the new one, so the largest image can only be just under half the available flash.