[En-Nut-Discussion] Problem with Ethernut Startup

Harald Kipp harald.kipp at egnite.de
Tue Jun 24 21:03:25 CEST 2003


You can check the .map file.

If globals and local statics are explicitly initialized,
they are in the data segment, otherwise they belong to bss.

Btw. avoid

    static int bar = 0;

as this will put two bytes in the data segment and waste
a two byte copy in flash memory for initialization.

    static int bar;

will put the variable in bss, which is automatically cleared
during initialization.

Harald

At 19:40 24.06.2003 +0200, you wrote:
> > The short answer is to never use large static structures. Allways use
> > malloc. Check the MAP file to make sure that the statics are only taking
>up
> > a <3K of SRAM.
>Sounds a bit stupid, but how do I see the size of statics?  Is it the bss
>segment?
>
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list