2010-09-15 07:43 AM
STVD - Cosmic - how do I know the flash code and ram usage?
2011-05-17 06:10 AM
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
2011-05-17 06:10 AM
2011-05-17 06:10 AM
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?!2011-05-17 06:10 AM
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.