cancel
Showing results for 
Search instead for 
Did you mean: 

Memory usage, stm8

MykolaLevun
Associate III

Hello

STM8S microcontroller. Cosmic compiler. How can I find out how much memory my C program is using and for what purposes?

1 ACCEPTED SOLUTION

Accepted Solutions
MykolaLevun
Associate III

I wrote to Cosmic technical support and they responded with the following: "It's described in the linker section of the compiler manual (CXSTM8_UsersGuide.pdf)."

View solution in original post

7 REPLIES 7

If the Linker generates a .MAP file perhaps review that.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yes, the linker generates a .map file. It is not particularly clear what these segments mean (see Figure 1 below)?

MykolaLevun_0-1709812874037.png

What do the numbers near the parentheses and in the parentheses mean? What do the arrows (>) next to some numbers mean (see Figure 2 bellow)?

MykolaLevun_1-1709813056234.png

What do the arrows such (>) and such (-->) mean (see Figure 3 bellow)?

MykolaLevun_2-1709813186974.png

 

Is there information on this topic somewhere? I did not find it in the Cosmic compiler documentation.


@MykolaLevun wrote:

I did not find it in the Cosmic compiler documentation.


Did you try https://www.cosmicsoftware.com/support.php ?

or https://www.cosmicsoftware.com/contact.php ?

Yes, I looked on the official website. Found nothing.

I don't think they make enough money from this deal, and the deal probably was that ST owned the support burden.. I'm sure Luca/Cosmic would provide support at reasonable engineering rates

https://www.cosmicsoftware.com/manuals.php

For Stack I think numbers referred to auto/locals and then parameters

For Call Tree there's a top-level count of functions in brackets, and then probably some call/stack type impact

I'm not using STM8 parts, but contextually the importance should be relevant to someone who is.

For the Object file it's showing all the sections, the debug/info likely not contributing to data pushed into the device, but text/const

MAP files are the place to look for Linker output, you can also likely unpack the Object file directly with a suitable dump tool, or generate .HEX or .BIN you can import or view independently too.

Quick Google

https://hw-by-design.blogspot.com/2018/07/8-bit-cosmic-c-memory-usage-report.html

https://community.st.com/t5/stm8-mcus/how-to-read-the-map-file/td-p/542058

 

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MykolaLevun
Associate III

I wrote to Cosmic technical support and they responded with the following: "It's described in the linker section of the compiler manual (CXSTM8_UsersGuide.pdf)."