[En-Nut-Discussion] EEPROM use

Ayman Hendawy ayman.hendawy at gmail.com
Mon May 14 22:12:20 CEST 2012


Dear Harald,

>It should work. Did you get any warnings from the compiler?
Nothing related to the EEPROM.


> Nothing special is required in the Makefile.
I don't have to make the compiler generate .eep file to burn it through the
programmer to the Atmega eeprom.

>if you like, you can replace NutNvMemXXX by OnChipNvMemXXX. The former is
just more portable, because not every CPU has an on-chip EEPROM.

I already using  OnChipNvMemXXX , what do you mean

>Are you aware, that the EESAVE fuse must be programmed to retain EEPROM
contents during chip erase?
EESAVE is already programmed.

I don't know what I have to do, it's very strange, any suggestions?

Thanks for your help.

Best Regards

On Mon, May 14, 2012 at 12:08 PM, Harald Kipp <harald.kipp at egnite.de> wrote:

> Hi Ayman,
>
> On 13.05.2012 10:16, Ayman Hendawy wrote:
> > uint8_t  save = 99;
> > uint8_t  load;
> > OnChipNvMemSave ( 512, &save, sizeof(uint8_t));
> >
> > OnChipNvMemLoad ( 512, &load, sizeof(uint8_t));
> >  But I never read 99 from load, I never read a correct value, I always
> read
> > garbag data,
>
> It should work. Did you get any warnings from the compiler?
>
> > may be the problem in the addresses, but I tried to change it many times
> > with different values with no result,
>
> The ATmega128 got 4096 EEPROM bytes, so address 512 is OK.
>
> > By the way may be the problem in the make file, how can I update make
> file
> > to create the necessary file.
>
> Nothing special is required in the Makefile.
>
> I assume, that the problem is somewhere else. Do you know the following
> page?
>
> http://www.ethernut.de/nutwiki/Non-Volatile_Memory
>
> If you like, you can replace NutNvMemXXX by OnChipNvMemXXX. The former is
> just more portable, because not every CPU has an on-chip EEPROM.
>
> Are you aware, that the EESAVE fuse must be programmed to retain EEPROM
> contents during chip erase?
>
> Regards,
>
> Harald
>
>
> P.S.: Please let us know what you found out. I'm still missing your
> response to
>
> http://lists.egnite.de/pipermail/en-nut-discussion/2012-March/013453.html
>
> I assume that you solved the problem. It may be helpful for others to know
> what went wrong. Thanks.
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>



-- 
Best regards

Ayman Hendawy
Embedded system engineer

Cairo,Egypt

Phone: +20110406659



More information about the En-Nut-Discussion mailing list