[En-Nut-Discussion] Problem with Ethernut Startup

Ralph Mason ralph.mason at telogis.com
Tue Jun 24 22:18:03 CEST 2003


Back on my protability horse.

Even better is

static int bar ZERO_INIT;

where ZERO_INIT is defined as nothing for environments that zero memory on
start-up and =0 on others.

Then you can use the code where you need to initialise variables also.

Ralph


> -----Original Message-----
> From: en-nut-discussion-admin at egnite.de
> [mailto:en-nut-discussion-admin at egnite.de]On Behalf Of Harald Kipp
> Sent: Wednesday, 25 June 2003 7:03
> To: en-nut-discussion at egnite.de
> Subject: Re: [En-Nut-Discussion] Problem with Ethernut Startup
>
>
> 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
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo/en-nut-discussion
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003




More information about the En-Nut-Discussion mailing list