- When you say 'project', do you mean a Polyspace project? Are the bootloader source files part of the Polyspace project?
- How do you know that the stack size estimation is not taking the bootloader sources into account?
Polyspace code prover not able to analyse stack for whole project
4 views (last 30 days)
Show older comments
Trying to get stack size for my project but code prover is giving only application level with initialization value.
Let me know how to get entire stack usage value for whole project with both application and bootloader.
0 Comments
Accepted Answer
Anirban
on 4 Dec 2020
Hi,
Could you provide some more information? For instance, the following would be helpful:
Just for your information, the software does compute a Program Maximum Stack Usage . In some situations, the result for this metric might show up as Not Computed. Is that what is happening here?
Whatever else you can state about your diagnosis of the problem can help us here.
2 Comments
Anirban
on 5 Jan 2021
Hi,
Gray checks should not prevent computation of program maximum stack usage. The function calls in gray code would simply be discounted from the computation.
The things that prevent stack usage computation are things that you would typically not have in your code:
- Red checks
- Infinite loops (These sometimes appear as Non-terminating loop red checks, but for trivial infinite loops that are perhaps intended, the loops are shown through a dashed red in the source code. )
- Recursive functions (In embedded code, recursive functions are discouraged. You can run the checker for MISRA C:2012 Rule 17.2 to detect these functions.)
If the stack usage of a function appears as Not computed, the stack usage of all functions upstream from this function will probably also appear as Not computed. One quick question comes to mind. Do you have a main function in your project or are you using the Polyspace option -main-generator?
More Answers (0)
See Also
Categories
Find more on Code Prover Analysis in Polyspace Platform User Interface in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!