[Top][All Lists]

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

Re: [avr-gcc-list] re: structures in EEProm

From: David Kelly
Subject: Re: [avr-gcc-list] re: structures in EEProm
Date: Tue, 23 Aug 2005 07:01:12 -0500

On Aug 23, 2005, at 1:11 AM, Jim Brooks wrote:

I would like to define some default data structures in EEProm and have them
loaded/initialzed when I program the Flash from Avr Studio.

Write to flash and write to eeprom are two separate processes.

I do things like this:

typedef struct {
    uint16_t    n, d;

SCALE    scale;
SCALE ee_scale __attribute__ ((section (".eeprom")))
        = { 1, 1 };

Early in my code I block copy ee_scale into scale for later quick access.

Looking at disassembly list files, map files, and hex files I generate the data is there. But not when AVR Studio writes the chip using the same dwarf-2 file used to generate the list, map, and hex files.

Had the "preserve EEPROM on chip erase" fuse selected and couldn't write the hex file to EEPROM without complaint of verification error. Looked to be the same mess as when the dwarf-2 was loaded, zeroed with wrong data in some places, occasionally right data in the wrong place. Unchecked that fuse bit and the hex file wrote and verified correctly. Have not tried loading the dwarf-2 file with that fuse change yet.

David Kelly N4HHE, address@hidden
Whom computers would destroy, they must first drive mad.

reply via email to

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