[En-Nut-Discussion] Save Data to the EEPROM

Harald Kipp harald.kipp at egnite.de
Tue Jun 1 19:50:13 CEST 2004


>I found the commands EEPROM_READ and EEPROM_WRITE.
>#define EEPROM_WRITE(addr,src)
>My problem now is to get the value for "addr". There are some constant 
>value in the examples like CONFNET_EE_OFFSET, but whats the value I need?

There's no pre-defined value, AFAIK. I recommend to
start at address 512. Anything from 0 to 511 is
weakly reserved for Nut/OS.

>Perhaps anybody knows a another way to save the Data?

No, EEPROM is the right place. Have a look into
nut/os/confos.c, NutLoadConfig() and NutSaveConfig().
This works with ICC and GCC. Note, that the value
is read before writing, which reduces wear out.
(Was it Alexander, who gave this hint?)


More information about the En-Nut-Discussion mailing list