[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: Ned Konz
Subject: Re: [avr-gcc-list] Non initialized data in EEPROM
Date: Wed, 06 Dec 2006 10:12:51 -0800
User-agent: Thunderbird (Macintosh/20061025)

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';


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.

Ned Konz

reply via email to

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