Sonsivri

Electronics => Pic C Languages => Topic started by: pascal06 on March 16, 2023, 10:48:18 10:48



Title: XC8 memory tool analyser
Post by: pascal06 on March 16, 2023, 10:48:18 10:48
Hello everybody,

I would want to analyse memory usage on a particular C code compiled with XC8.
Generally, some would analyse BSS, text and data segment.
There are tools for that (at least I know two):
https://github.com/govind-mukundan/MapViewer
https://www.sikorskiy.net/info/prj/amap/
No chances, theses are working only with GCC, that seems to be not the case with XC8.
Do you know or use this kind of tools ?
My goal is to optimise my program.

Thanks a lot in advance,
Pascal


Title: Re: XC8 memory tool analyser
Post by: danymogh on March 16, 2023, 02:26:51 14:26
XC8 already produces flash and memory usage. you just need to tell the compiler to generate map files.
then open it with a text editor and you'll see all variables and functions along with their address and size.
it's not a pretty output like the tools you mentioned but it'll do for most jobs.