[Top][All Lists]

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

Re: [avr-gcc-list] Non initialized data in EEPROM

From: dimax un
Subject: Re: [avr-gcc-list] Non initialized data in EEPROM
Date: Thu, 7 Dec 2006 10:41:26 +0200

On 12/6/06, Ned Konz <address@hidden> wrote:
dimax un wrote:

> I have an array and some config data in eeprom
> char config_data __attribute__ ((section (".eeprom"))) = 5;
> char eep_array[1024] __attribute__ ((section (".eeprom")));
> I use array as temporary storage.

In the EEPROM? So you use the various eeprom functions in avr/eeprom.h
to read and write this area? You know you can't just use it like

eep_array[3] = 'C';


Right. I do not have a problem to access EEPROM. I usee
eeprom_read/write functions. The question is how to minimize HEX image
for EEPROM. I need something like non initialized data in EEPROM.

> The make produces hex file for
> EEPROM image that is 1024+1 = 1025 bytes long. Actually I do not need
> eep_array to be initialized and thus do not want to burn it. Do you
> see any chance to declare some place in eeprom but make it non
> initialized and do not have it in EEPROM image hex file to minimize
> burning time.

Given that config_data is at the beginning of EEPROM, why not just use 0
as its EEPROM address? After all, you can't directly read and write to
EEPROM anyway; you have to use the EEPROM functions and give them
offsets into EEPROM.

What I generally do is to define a pointer to the beginning of EEPROM by
taking the address of the first EEPROM data item I've defined, and then
calculate offsets from it to various data items in EEPROM.

This is not a problem. I know exactly hot to access all my data in
EEPROM. I only say that some of that data is not initialized and thus
I do not want to see it in HEX file. But I do want the place to be

As far as I can see I will have to declare special section without
"loadable" flag so that it will not be taken to produce image. This
may require to access linker scripts and I do not want to do it very
much. Probably there is any other option?

Ned Konz

; Micro connection to the MacroVision
; http://www.xdimax.com

reply via email to

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