avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] Problem reading from EEPROM


From: Dave Petrizze
Subject: RE: [avr-gcc-list] Problem reading from EEPROM
Date: Mon, 14 Jul 2003 12:18:21 -0600

I had this very problem the other day.  Don't pass the addresses but cast
them as pointers.

v0 = eeprom_read_byte((uint8_t *)val1);

This worked for me.

Dave Petrizze

-----Original Message-----
From: address@hidden
[mailto:address@hidden Behalf Of Arthur Goldhammer
Sent: Monday, July 14, 2003 12:15 PM
To: address@hidden
Subject: [avr-gcc-list] Problem reading from EEPROM


I'm trying to read data from the EEPROM of an 8515. I've got the following
statements:

#define EEPROM __attribute__((section(".eeprom")))

uint8_t val1 EEPROM = 'o';
uint8_t val2 EEPROM = 'x';

Later, I have these lines:

  uint8_t v0, v1;
    v0 = eeprom_read_byte(&val1);
    v1 = eeprom_read_byte(&val2);

But both v0 and v1 are 0xff after execution of the last two lines. What am I
doing wrong? I dumped the EEPROM to make sure the data are in there. It
looks OK.

I'm using the latest CVS version of avr-gcc:
gcc version 3.3 20030512 (prerelease)

Thanks,
Art



_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list



reply via email to

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