[En-Nut-Discussion] Unnecessary writing accesses to the eeprom while saving of the network config

Harald Kipp harald.kipp at egnite.de
Tue Jan 26 19:36:39 CET 2010


Hi Ole,

Ole Reinhardt wrote:
> I reviewed some patches on Sourceforge and found an earlier patch from
> Rich Peters who modified NutNetIfSetup() to not automatically save the
> Network config every time it is called. This will eat up the writing
> cycles of the eeprom or flash as it is called every time the device is
> powered up.

In
http://ethernut.svn.sourceforge.net/viewvc/ethernut?view=rev&revision=2392
I removed NutSaveConfig() from Nut/OS Code. The application is now
responsible to update this part of the EEPROM.

I thought I did the same for NutNetSaveConfig(), but obviously I didn't.
It is still in net/ifconfig.c. I think this has been kept, so that
Nut/OS can remember its last IP address.

However, at least for the AVR, bytes to write are verified with the
current EEPROM contents and only written, when they differ. Wouldn't
that be a good solution in general?


> I would vote to remove the automatic saving in this function. Perhaps
> this is a good starting point to think about the whole network
> configuration process again?
> 
> Any ideas?

Not really, but the network configuration always had been a mess during
all the 9 years of its existence. The trouble was, that the first
version didn't support DHCP. Since this was "hacked in" (really), things
became worse, while trying to keep backward compatibility.

Sooner or later we need more then one network interface and things may
become totally weird, if we try to keep them compatible. I'd vote for
using a completely new design. The existing routines/modules may be kept
for a while, marked as deprecated.

Harald




More information about the En-Nut-Discussion mailing list