EEPROM

Hello!

The DUE has a EEPROM ?

What is the capacity of it?

If not, is there another memory to replace it?

The library EEPROM.h is still valid?

Best regards.

Fernando Garcia

No EEPROM but there is the ability with ARMs to do IAP (In Application Programming) which writes into flash. This could be used for non-volatile storage but someone will have to write the code. Maybe the Arduino guys have converted the EEPROM library to do this.


Rob

Maybe the Arduino guys have converted the EEPROM library to do this.

It doesn't look like they have, I can't see any reference to a new EEPROM library and the old EEPROM.h file is the same as is always was. Maybe it's buried somewhere too obscure for my greps.


Rob

Hi!

actually there is no EEPROM support on the Due.

Graynomad, i see some difficult to develop a drop-in replacement of EEPROM lib because:

  • To modify a single byte of flash memory you are forced to rewrite an entire "page", (that is 256 bytes).
  • Before writing a "page" of flash memory you need to erase it, so you should read temporary in RAM the old flash content, start erase, apply the changes in ram and finally write the updated page.

Said that, the idea of using the Flash memory is not bad, and using the EEFC device of SAM3X should be not too hard to create a simple FLASH library, maybe with a slightly different API from EEPROM that take in consideration the limits above.

C

IIRC the 16u2 has a small EEPROM, but to access that from the SAM3X it would need some special firmware and some means of communicating between the two.

  • To modify a single byte of flash memory you are forced to rewrite an entire "page", (that is 256 bytes).
  • Before writing a "page" of flash memory you need to erase it, so you should read temporary in RAM the old flash content, start erase, apply the changes in ram and finally write the updated page.

Hmm, one thing I'm considering for a project is a kind of pseudo virtual memory manager so I can safely use dynamic memory with only one allocation at app start. This 'IAP' could be some memory shortage fail safe when used for paging.

Can probably be used as a resource repository / registry. So many cool things I want to try.

Hello!
Thanks for the replies.
Just do not understand how important things like this were not implemented before the release of the product.

Best regards.
Fernando Garcia

FernandoGarcia:
Just do not understand how important things like this were not implemented before the release of the product.

Because if everyone was satisfied before it released it never would. It's not difficult to write a EEPROM library that uses the flash. I'm already working on one.

Just do not understand how important things like this were not implemented before the release of the product.

Because the arduino is a development platform. However people seem to think that all trivial things should be presented as a library. There have been many years of unnecessary trivial function library development for the existing system, you can't expect that over night.

Hi there!

I just got my brand new Arduino Due and realized the hard way that the EEPROM library is no longer supported.

Are there any news on EEPROM-equivalent functionality being supported?

Thanx in advance! :slight_smile:

Dimdim:
Hi there!

I just got my brand new Arduino Due and realized the hard way that the EEPROM library is no longer supported.

Are there any news on EEPROM-equivalent functionality being supported?

Thanx in advance! :slight_smile:

Better late than never? If you're willing to do a little hardware and software mod, you can utilize some EEPROM memory that is already on the board. See my post at New Arduino Due Library: DueEEPROM - Libraries - Arduino Forum.

Enjoy!

I have created a library for Arduino Due at GitHub - sebnil/DueFlashStorage: DueFlashStorage saves non-volatile data for Arduino Due. The library is made to be similar to the EEPROM library.
The library is made to be similar to the EEPROM library. It will save non-volatile data but the flash storage is reset every time you upload a new sketch to your Arduino. Except for that exception it works the same as EEPROM for the older Arduinos. Remove power or press the reset button, the data will still be there.

Basic use:

// write the value 123 to address 0
dueFlashStorage.write(0,123);

// read byte at address 0
byte b = dueFlashStorage.read(0);

I hope you will find it useful.

Fantastic!

The in ability to save to a permanent store on the DUE has always been its down fall in my eyes.

Ill be trying this out for a few projects soon :slight_smile:

Question, there's 512KB of Flash on the DUE.
Does this library use the final (1kb? 2KB? 5KB?) for use with the library or do you define this during initialising of the sketch?

Keep in mind that using flash memory for your storage is NOT permanent! Devices like the Due are meant to be programmed lots of times. Every single time you write a new sketch (or update your current one) it will erase the entirety of flash space including your stored stuff. There is no way around this. Sebnil mentioned this but I thought it good to reiterate this point strongly as it totally kills the usefulness for many people. If it still works fine for you then, by all means, have at it. Otherwise you might need to add an I2C connected EEPROM chip or follow m3741's link.

Horendus:
Fantastic!

The in ability to save to a permanent store on the DUE has always been its down fall in my eyes.

Ill be trying this out for a few projects soon :slight_smile:

Question, there's 512KB of Flash on the DUE.
Does this library use the final (1kb? 2KB? 5KB?) for use with the library or do you define this during initialising of the sketch?

An I2C EEPROM chip on one of the I2C busses is one workaround. Later
board revisions could incorporate one too?