cancel
Showing results for 
Search instead for 
Did you mean: 

STVD - Cosmic - how do I know the flash code and ram usage?

Mario Luzeiro
Senior
Posted on September 15, 2010 at 16:43

STVD - Cosmic - how do I know the flash code and ram usage?

4 REPLIES 4
brazov22
Associate II
Posted on May 17, 2011 at 15:10

click on View -> Memory

then in the top box put 8000h to see EEPROM content and code size and 0000h to see RAM size. ROM is located at 6000h (STM8S).

brazov

luca239955_stm1_st
Senior II
Posted on May 17, 2011 at 15:10

the first few lines of the map file contain all the info you are looking for.

Mario Luzeiro
Senior
Posted on May 17, 2011 at 15:10

I've look for .map but can't understand it much, so I asked Cosmic support and they reply it to me:

> .text, .const and .vector are ROM

> .bsct, .ubsct, .data and .bss are all RAM

> .info. and .debug are symbol tables that do not use target resources/memory.

I notice that my code is about 3K size, and I'm just using GPIO, TIM2 and UART from STD Lib to toggling a LED with interrupts. I'm compile for release with code size optimization, i'm not using asserts, printfs or something big. where can it be wasting so much size?!

Mario Luzeiro
Senior
Posted on May 17, 2011 at 15:10

I've found in STD Lib documentation:

''

Since the Standard Peripherals Library is generic and covers all peripheral functionalities, the size and/or execution speed of the application code may not be optimized.''

''

As example, for Cosmic compiler to have the smallest code size the following options should be enabled (default configuration used in Standard Peripherals Library template project):

+compact: produce a smaller code but slower than the default behavior.

+split: create a separate sub-section per function thus allowing the linker to remove unused functions and variables from the final application image.