EmbDev.net

Forum: µC & Digital Electronics xc32 static stack analyzer


von Little B. (lil-b)


Rate this post
useful
not useful
Hello together!

I developed a static stack analyzer for Microchip's XC32 compiler, which 
can be found here:

https://github.com/SentinelSw/MipsStaticStackAnalyzer


Some background:

For an automotive project a pic32mz is used and the software for it is 
compiled with microchip's xc32. To comply with ASIL-B requirements from 
customer, we had to do a static memory analysis. Easy for flash and 
static RAM usage, as it is part of the map file. But what about the 
static stack usage?

Fact is, that microchip does not have a tool for it, and if you ask 
them, they tell you that you should measure the stack usage dynamically 
during runtime. Thats not an option for an automotive project, of 
course.

After weeks of discussion, internally and with microchip, I got the task 
to find a solution. You can find my solution in the link above, which I 
was allowed to publish under GPLv3 by my contractor.

And to all those smart people out there, who are saying "But xc32 is 
gcc-based, so why are you not using -fstack-usage?"
The answer of Microchip: This feature is officially not supported by 
xc32 and you should not use it.

This, and the fact, that there is no 3rd party tool, which does a static 
code analysis for microchip or mips controller in general, made me 
publish this program for the community.

Bug tracking on github, but there will be no additional major features.

Greetings
Florian Kaup
Sentinel Software GmbH

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.