Topic : STM32 and generated Code size

Forum : ARM

Original Post
Post Information Post
November 4, 2008 - 5:03pm
Guest

Hi all,

i'm new to the STM32 AND new to the RIDE-Environment. There is actual one short question: How can i figure out what is the code size of the generated code.
I looked in the .map file (there i supposed to find the information) but couldn't find anything. I look for a setting in the project options but i couldn't find the desired switch to turn this on or off!

Additional: Is there any possiblility to genereate a checksum or similiar as i knwo this from IAR?

Please help me on this topics!

Thanks

Replies
Post Information Post
+1
0
-1
November 5, 2008 - 7:57am
Guest

You should find blue text in your project manager window next to each file e.g. text=xxxx data=xxx bss=xxx. The same text is written next to name of a project and this is size of a project.

Download latest version of Ride 7 it used to disappear sometimes before.

+1
0
-1
November 5, 2008 - 8:45am
Guest

Thanks,

i have seen this data, but couldn't believe that i have to take the number after the word "text" as as code size!

+1
0
-1
November 5, 2008 - 10:51am
Guest

Hi Socrates,

Can you verify it? I post this information but I have never test it in reliable manner ...

+1
0
-1
November 5, 2008 - 11:54pm
Guest

yes, it is common for software tools to refer to the section containing the executable code as "TEXT"

no doubt there is some historical reason for this - it is left as an exercise for the reader to pursue this if so inclined...

+1
0
-1
November 6, 2008 - 7:35am
Guest

Hi jaroslwa.oska,

yes it seems to be the correct code size!

Thanks again

+1
0
-1
November 7, 2008 - 10:50am
Guest

I noticed that if the initialization structure (for example):

GPIO_InitTypeDef GPIO_InitStructure;

is declared outside main() and all the other functions, the code is smaller than declaring it inside a function:

void GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
.....;
.....;
}

But why? Shouldn't it be the opposite?

+1
0
-1
November 10, 2008 - 9:53am
Guest

You can't conclude that on a general note - It depends on many things, like if the Compiler is able to assign the locally defined variables to a register without having to generate extra code to handle it, or if the compiler is creating the variable on the stack. You will have to look at the list files and find your answer.. This is an important step when trying to generate optimal code, on a side note the gcc compiler is not as efficient as Keil's ARM compiler when it comes to generate efficient code without twiddling a bit with your source, however you can't beat the price!

/Henrik