We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
dear all, How to compute maximum Stack Size require for specific application? Is Keil compiler specify Stack Size require for application after linking operation? Regards... Yogesh
I'd dearly love for a compiler to give me a stack size, and identify the critical path through the call tree. It is not possible always to give a complete answer (consider recursion), but a compiler can certainly do most of the work and provide total usage for the main call tree, each interrupt, and so on. C51 is already most of the way there thanks to its overlay analysis. It just needs to output the results. But I've never used a tool that does this. You can either go through the code and add up stack sizes by hand. Or, another common method is to fill the stack area with a known pattern, run the code, and see how much got overwritten. This latter method assumes your test suite actually puts the code through its worst-case stack usage, which may not be true. If you're making good use of the overlay feature, then much of the "stack" is determined at compile time. You can find this memory usage in the map file, and it is reflected in the total size of data / xdata reported by the compiler.