[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Avoiding memory initialization

From: Lai Kang Tin
Subject: Re: [avr-gcc-list] Avoiding memory initialization
Date: Fri, 19 Oct 2001 23:12:41 +0800 (HKT)


There is a loop inside the C startup code for zeroing the bss segment,
to realize your requirement, you need to modify the C startup code
for your own. The startup code uses symbol __bss_end to stop the zeroing loop,
you change it to (__bss_end - 10), ten bytes assumed for your application.

To access these 10 bytes storage, use pointer in your codes:

extern unsigned __bss_end;
char *pointer = (char *)(&__bss_end - 10);

void func()
        *pointer = 0x12;


Kang Tin LAI

On Wed, 17 Oct 2001, [iso-8859-1] S S wrote:

> Hello Everybody,
> I am using Atmega103. I have declared an array of char
> which I do not wish to get initialized on every CPU
> reset signal. I am keeping some acquired data here. In
> short I want to use this array as battery backed up
> RAM. However startup code clears the entire bss
> section on every reset signal. Is there a way to avoid
> this? Can somebody provide me source code to do the
> same?
> Thanks.
> Sean.
> ____________________________________________________________
> *NEW*   Connect to Yahoo! Messenger through your mobile phone   *NEW*
>        Visit http://in.mobile.yahoo.com/smsmgr_signin.html
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list


reply via email to

[Prev in Thread] Current Thread [Next in Thread]